get rid of the old _vhd methods
This patchset gets rid of all the old download_vhd/upload_vhd code. The old _vhd calls won't work anymore since we won't send them the right parameters. Change-Id: I8c0b47a7e8a94ee4b20c888bd86c1a77920103b8
This commit is contained in:
@@ -168,7 +168,7 @@ class FakeSessionForVMTests(fake.SessionBase):
|
||||
"# Completed on Sun Nov 6 22:49:02 2011\n")
|
||||
|
||||
def host_call_plugin(self, _1, _2, plugin, method, _5):
|
||||
if plugin == 'glance' and method in ('download_vhd', 'download_vhd2'):
|
||||
if plugin == 'glance' and method in ('download_vhd2'):
|
||||
root_uuid = _make_fake_vdi()
|
||||
return pickle.dumps(dict(root=dict(uuid=root_uuid)))
|
||||
elif (plugin, method) == ("xenhost", "iptables_config"):
|
||||
|
||||
@@ -663,7 +663,6 @@ class SessionBase(object):
|
||||
assert vdi_ref
|
||||
return pickle.dumps(None)
|
||||
|
||||
_plugin_glance_upload_vhd = _plugin_pickle_noop
|
||||
_plugin_glance_upload_vhd2 = _plugin_pickle_noop
|
||||
_plugin_kernel_copy_vdi = _plugin_noop
|
||||
_plugin_kernel_create_kernel_ramdisk = _plugin_noop
|
||||
|
||||
@@ -397,24 +397,6 @@ def download_vhd2(session, image_id, endpoint,
|
||||
utils.cleanup_staging_area(staging_path)
|
||||
|
||||
|
||||
def download_vhd(session, image_id, glance_host, glance_port, glance_use_ssl,
|
||||
uuid_stack, sr_path, extra_headers):
|
||||
"""Download an image from Glance, unbundle it, and then deposit the VHDs
|
||||
into the storage repository
|
||||
"""
|
||||
staging_path = utils.make_staging_area(sr_path)
|
||||
try:
|
||||
# Download tarball into staging area and extract it
|
||||
_download_tarball(
|
||||
sr_path, staging_path, image_id, glance_host, glance_port,
|
||||
glance_use_ssl, extra_headers)
|
||||
|
||||
# Move the VHDs from the staging area into the storage repository
|
||||
return utils.import_vhds(sr_path, staging_path, uuid_stack)
|
||||
finally:
|
||||
utils.cleanup_staging_area(staging_path)
|
||||
|
||||
|
||||
def upload_vhd2(session, vdi_uuids, image_id,
|
||||
endpoint, sr_path, extra_headers, properties):
|
||||
"""Bundle the VHDs comprising an image and then stream them into Glance.
|
||||
@@ -428,19 +410,5 @@ def upload_vhd2(session, vdi_uuids, image_id,
|
||||
utils.cleanup_staging_area(staging_path)
|
||||
|
||||
|
||||
def upload_vhd(session, vdi_uuids, image_id, glance_host, glance_port,
|
||||
glance_use_ssl, sr_path, extra_headers, properties):
|
||||
"""Bundle the VHDs comprising an image and then stream them into Glance.
|
||||
"""
|
||||
staging_path = utils.make_staging_area(sr_path)
|
||||
try:
|
||||
utils.prepare_staging_area(sr_path, staging_path, vdi_uuids)
|
||||
_upload_tarball(staging_path, image_id, glance_host, glance_port,
|
||||
glance_use_ssl, extra_headers, properties)
|
||||
finally:
|
||||
utils.cleanup_staging_area(staging_path)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
utils.register_plugin_calls(download_vhd, upload_vhd,
|
||||
download_vhd2, upload_vhd2)
|
||||
utils.register_plugin_calls(download_vhd2, upload_vhd2)
|
||||
|
||||
Reference in New Issue
Block a user