From aeef5c3f1917969fc2dc524346784b197729a9e9 Mon Sep 17 00:00:00 2001 From: Yaguang Tang Date: Wed, 8 May 2013 16:08:05 +0800 Subject: Fix variable referenced before assginment in vmwareapi code. Add unitests for VMwareapi vm_util. fix bug #1177689 Change-Id: If16109ee626c197227affba122c2e4986d92d2df --- nova/virt/vmwareapi/vm_util.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'nova/virt') diff --git a/nova/virt/vmwareapi/vm_util.py b/nova/virt/vmwareapi/vm_util.py index 9fb8e9bd5..4287b4eaa 100644 --- a/nova/virt/vmwareapi/vm_util.py +++ b/nova/virt/vmwareapi/vm_util.py @@ -553,7 +553,6 @@ def get_datastore_ref_and_name(session, cluster=None, host=None): "Datastore", data_store_mors, ["summary.type", "summary.name", "summary.capacity", "summary.freeSpace"]) - for elem in data_stores: ds_name = None ds_type = None @@ -570,8 +569,6 @@ def get_datastore_ref_and_name(session, cluster=None, host=None): ds_free = prop.val # Local storage identifier if ds_type == "VMFS" or ds_type == "NFS": - data_store_name = ds_name - return elem.obj, data_store_name, ds_cap, ds_free + return elem.obj, ds_name, ds_cap, ds_free - if data_store_name is None: raise exception.DatastoreNotFound() -- cgit