diff --git a/IM/connectors/OpenNebula.py b/IM/connectors/OpenNebula.py index ae3298087..83ce0caa6 100644 --- a/IM/connectors/OpenNebula.py +++ b/IM/connectors/OpenNebula.py @@ -570,7 +570,11 @@ def finalize(self, vm, last, auth_data): self.delete_snapshots(vm, auth_data) if vm.id: - success, err = server.one.vm.action(session_id, 'delete', int(vm.id))[0:2] + one_ver = self.getONEVersion(auth_data) + op = 'terminate' + if one_ver <= LooseVersion("4.14.0"): + op = 'delete' + success, err = server.one.vm.action(session_id, op, int(vm.id))[0:2] else: self.log_warn("No VM ID. Ignoring") err = "" @@ -1176,7 +1180,7 @@ def create_snapshot(self, vm, disk_num, image_name, auto_delete, auth_data): image_type = "" # Use the default one one_ver = self.getONEVersion(auth_data) - if one_ver.startswith("5."): + if one_ver >= LooseVersion("5.0"): success, res_info = server.one.vm.disksaveas(session_id, int(vm.id), disk_num, image_name, image_type, -1)[0:2] else: diff --git a/README.md b/README.md index 3b0409490..5fee8d0d3 100644 --- a/README.md +++ b/README.md @@ -106,8 +106,8 @@ However, if you install IM from sources you should install: * The RADL parser (), available in pip as the ``RADL`` package. * The paramiko ssh2 protocol library for python version 1.14 or later -(), typically available as the -``python-paramiko`` package. + (), typically available as the + ``python-paramiko`` package. * The YAML library for Python, typically available as the ``python-yaml`` or ``PyYAML`` package. * The suds library for Python, typically available as the ``python-suds``