diff --git a/IM/connectors/GCE.py b/IM/connectors/GCE.py index ead0fcea9..1d6645118 100644 --- a/IM/connectors/GCE.py +++ b/IM/connectors/GCE.py @@ -260,8 +260,8 @@ def get_instance_type(self, sizes, radl): # get the node size with the lowest price and memory (in the case # of the price is not set) if size.price is None: - size.price = 0 - if res is None or (size.price <= res.price and size.ram <= res.ram): + size.price = 9999 + if res is None or (size.price <= res.price or size.ram <= res.ram): str_compare = "" if 'guestCpus' in size.extra and size.extra['guestCpus']: str_compare = "size.extra['guestCpus'] " + cpu_op + " cpu and " diff --git a/IM/connectors/OpenNebula.py b/IM/connectors/OpenNebula.py index 0b923a81c..39c4e5d82 100644 --- a/IM/connectors/OpenNebula.py +++ b/IM/connectors/OpenNebula.py @@ -14,15 +14,16 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import hashlib +import defusedxml.xmlrpc +defusedxml.xmlrpc.monkey_patch() + try: from xmlrpclib import ServerProxy except ImportError: from xmlrpc.client import ServerProxy +import hashlib import time -import defusedxml.xmlrpc -defusedxml.xmlrpc.monkey_patch() from distutils.version import LooseVersion from IM.xmlobject import XMLObject