mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 15:15:22 +00:00
Merge pull request #153 from hongweipeng/patch-1
fix:sorted btween 'dict' and 'dict'
This commit is contained in:
commit
16ff1fb52e
1 changed files with 2 additions and 2 deletions
|
@ -330,7 +330,7 @@ def instance(request, compute_id, vname):
|
|||
console_type = conn.get_console_type()
|
||||
console_port = conn.get_console_port()
|
||||
console_keymap = conn.get_console_keymap()
|
||||
snapshots = sorted(conn.get_snapshot(), reverse=True)
|
||||
snapshots = sorted(conn.get_snapshot(), reverse=True, key=lambda k:k['date'])
|
||||
inst_xml = conn._XMLDesc(VIR_DOMAIN_XML_SECURE)
|
||||
has_managed_save_image = conn.get_managed_save_image()
|
||||
clone_disks = show_clone_disk(disks, vname)
|
||||
|
@ -955,7 +955,7 @@ def delete_instance(instance, delete_disk=False):
|
|||
print("Forcing shutdown")
|
||||
conn.force_shutdown()
|
||||
if delete_disk:
|
||||
snapshots = sorted(conn.get_snapshot(), reverse=True)
|
||||
snapshots = sorted(conn.get_snapshot(), reverse=True, key=lambda k:k['date'])
|
||||
for snap in snapshots:
|
||||
print("Deleting snapshot {}".format(snap['name']))
|
||||
conn.snapshot_delete(snap['name'])
|
||||
|
|
Loading…
Reference in a new issue