From 59abf7ae5aa27a87700a1e2f2b379904e5774a9b Mon Sep 17 00:00:00 2001 From: "Kevin L. Mitchell" Date: Thu, 13 Oct 2011 14:58:19 -0500 Subject: Remove redundant, dead code. Removes the module-level function get_vdi_for_vm_safely(), which was not used; everything used VMHelper.get_vdi_for_vm_safely(). Change-Id: I8c9c5aa3150384da201c36f1842ae5a09b90f431 --- nova/virt/xenapi/vm_utils.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index 8230afbf6..a7a551bc5 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -920,22 +920,6 @@ def wait_for_vhd_coalesce(session, instance_id, sr_ref, vdi_ref, return parent_uuid -def get_vdi_for_vm_safely(session, vm_ref): - vdi_refs = VMHelper.lookup_vm_vdis(session, vm_ref) - if vdi_refs is None: - raise Exception(_("No VDIs found for VM %s") % vm_ref) - else: - num_vdis = len(vdi_refs) - if num_vdis != 1: - raise exception.Error(_("Unexpected number of VDIs" - "(%(num_vdis)s) found" - " for VM %(vm_ref)s") % locals()) - - vdi_ref = vdi_refs[0] - vdi_rec = session.get_xenapi().VDI.get_record(vdi_ref) - return vdi_ref, vdi_rec - - def safe_find_sr(session): """Same as find_sr except raises a NotFound exception if SR cannot be determined -- cgit