diff options
author | Jenkins <jenkins@review.openstack.org> | 2012-10-01 21:56:20 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2012-10-01 21:56:20 +0000 |
commit | d399c755688c5c4d7f7aa5cb5fa8a55b4319f9ff (patch) | |
tree | 2f9a13bc50847ec240f291934cf6ec3863cc495e /plugins/xenserver | |
parent | 14cfc19381b7f923b9c0e174038810a1a1aec5dc (diff) | |
parent | a36288351af519ef62ad4f52b3e3e38601ba3f58 (diff) | |
download | nova-d399c755688c5c4d7f7aa5cb5fa8a55b4319f9ff.tar.gz nova-d399c755688c5c4d7f7aa5cb5fa8a55b4319f9ff.tar.xz nova-d399c755688c5c4d7f7aa5cb5fa8a55b4319f9ff.zip |
Merge "xenapi: Removing legacy swap-in-image."
Diffstat (limited to 'plugins/xenserver')
-rw-r--r-- | plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py b/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py index 027d26a67..66f46a839 100644 --- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py @@ -221,6 +221,7 @@ def _validate_sequenced_vhds(staging_path): if not filename.endswith('.vhd'): continue + # Ignore legacy swap embedded in the image, generated on-the-fly now if filename == "swap.vhd": continue @@ -242,13 +243,11 @@ def import_vhds(sr_path, staging_path, uuid_stack): Returns: A dict of imported VHDs: - {'root': {'uuid': 'ffff-aaaa'}, - 'swap': {'uuid': 'ffff-bbbb'}} + {'root': {'uuid': 'ffff-aaaa'}} """ _handle_old_style_images(staging_path) _validate_sequenced_vhds(staging_path) - imported_vhds = {} files_to_move = [] # Collect sequenced VHDs and assign UUIDs to them @@ -286,26 +285,12 @@ def import_vhds(sr_path, staging_path, uuid_stack): _assert_vhd_not_hidden(leaf_vhd_path) _validate_vdi_chain(leaf_vhd_path) - imported_vhds["root"] = {"uuid": leaf_vhd_uuid} - - # Handle swap file if present - orig_swap_path = os.path.join(staging_path, "swap.vhd") - if os.path.exists(orig_swap_path): - # Rename swap.vhd -> aaaa-bbbb-cccc-dddd.vhd - vhd_uuid = uuid_stack.pop() - swap_path = os.path.join(staging_path, "%s.vhd" % vhd_uuid) - _rename(orig_swap_path, swap_path) - - _assert_vhd_not_hidden(swap_path) - - imported_vhds["swap"] = {"uuid": vhd_uuid} - files_to_move.append(swap_path) - # Move files into SR for orig_path in files_to_move: new_path = os.path.join(sr_path, os.path.basename(orig_path)) _rename(orig_path, new_path) + imported_vhds = dict(root=dict(uuid=leaf_vhd_uuid)) return imported_vhds |