summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSalvatore Orlando <salvatore.orlando@eu.citrix.com>2011-03-08 18:20:20 +0000
committerSalvatore Orlando <salvatore.orlando@eu.citrix.com>2011-03-08 18:20:20 +0000
commit3d6e5d82e6cf70ae6e11c66d3e8ccadaccf93987 (patch)
treea6f5ec6824f4f62a8311415d85b082482121fc7a /plugins
parent9610c61055ab84038becf4af0b63bab9071a900a (diff)
Removes VDIs from XenServer backend if spawn process fails before vm rec is created.
Fixed pep8 errors.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/xenserver/xenapi/etc/xapi.d/plugins/glance15
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
index aa12d432a..4251461ae 100644
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
@@ -351,18 +351,25 @@ def copy_kernel_vdi(session, args):
_copy_kernel_vdi('/dev/%s' % dev, copy_args))
return filename
-
+
def remove_kernel_ramdisk(session, args):
"""Removes kernel and/or ramdisk from dom0's file system"""
- kernel_file = exists(args, 'kernel-file')
- ramdisk_file = exists(args, 'ramdisk-file')
+ kernel_file = optional(args, 'kernel-file')
+ ramdisk_file = optional(args, 'ramdisk-file')
if kernel_file:
os.remove(kernel_file)
+ else:
+ kernel_uuid = optional(args, 'kernel-uuid')
+ if kernel_uuid:
+ os.remove(KERNEL_DIR + '/' + kernel_uuid)
if ramdisk_file:
os.remove(ramdisk_file)
+ else:
+ ramdisk_uuid = optional(args, 'ramdisk-uuid')
+ if ramdisk_uuid:
+ os.remove(KERNEL_DIR + '/' + ramdisk_uuid)
return "ok"
-
if __name__ == '__main__':
XenAPIPlugin.dispatch({'upload_vhd': upload_vhd,
'download_vhd': download_vhd,