Skip to content

Commit

Permalink
Merge pull request #1405 from grycap/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
micafer authored Sep 2, 2022
2 parents b1f991e + d9a0c4b commit bc9d241
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions IM/connectors/OpenNebula.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ However, if you install IM from sources you should install:
* The RADL parser (<https://github.com/grycap/radl>), available in pip
as the ``RADL`` package.
* The paramiko ssh2 protocol library for python version 1.14 or later
(<http://www.lag.net/paramiko/>), typically available as the
``python-paramiko`` package.
(<http://www.lag.net/paramiko/>), 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``
Expand Down

0 comments on commit bc9d241

Please sign in to comment.