summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSalvatore Orlando <salvatore.orlando@eu.citrix.com>2011-02-24 11:43:40 +0000
committerSalvatore Orlando <salvatore.orlando@eu.citrix.com>2011-02-24 11:43:40 +0000
commit7e463d262339acc7c611b86471b1422dea50d1ee (patch)
tree76ad649dbf7c33bab233d3807811def6b368673f
parentf277be5839c76dc2b9efb6ad49dc2a979b1a028d (diff)
downloadnova-7e463d262339acc7c611b86471b1422dea50d1ee.tar.gz
nova-7e463d262339acc7c611b86471b1422dea50d1ee.tar.xz
nova-7e463d262339acc7c611b86471b1422dea50d1ee.zip
xenapi plugin function now checks whether /boot/guest already exists.
If not, it creates the directory
-rw-r--r--plugins/xenserver/xenapi/etc/xapi.d/plugins/glance4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
index 8cb439259..61b947c25 100644
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
@@ -73,6 +73,10 @@ def _copy_kernel_vdi(dest, copy_args):
logging.debug("copying kernel/ramdisk file from %s to /boot/guest/%s",
dest, vdi_uuid)
filename = KERNEL_DIR + '/' + vdi_uuid
+ #make sure KERNEL_DIR exists, otherwise create it
+ if not os.path.isdir(KERNEL_DIR):
+ logging.debug("Creating directory %s", KERNEL_DIR)
+ os.makedirs(KERNEL_DIR)
#read data from /dev/ and write into a file on /boot/guest
of = open(filename, 'wb')
f = open(dest, 'rb')