Permalink
Browse files

Merge "VMware: validate the network_info is defined"

  • Loading branch information...
2 parents 7d85aaf + 6003726 commit 568f9b32268bb1fd08a53be20b2f073d8d58f840 Jenkins committed with openstack-gerrit Jul 19, 2014
Showing with 6 additions and 1 deletion.
  1. +5 −0 nova/tests/virt/vmwareapi/test_vif.py
  2. +1 −1 nova/virt/vmwareapi/vif.py
@@ -328,6 +328,11 @@ def test_get_vif_info_none(self):
'is_neutron', 'fake_model', None)
self.assertEqual([], vif_info)
+ def test_get_vif_info_empty_list(self):
+ vif_info = vif.get_vif_info('fake_session', 'fake_cluster',
+ 'is_neutron', 'fake_model', [])
+ self.assertEqual([], vif_info)
+
@mock.patch.object(vif, 'get_network_ref', return_value='fake_ref')
def test_get_vif_info(self, mock_get_network_ref):
network_info = utils.get_test_network_info()
@@ -156,7 +156,7 @@ def get_network_ref(session, cluster, vif, is_neutron):
def get_vif_info(session, cluster, is_neutron, vif_model, network_info):
vif_infos = []
- if not network_info:
+ if network_info is None:
return vif_infos
for vif in network_info:
mac_address = vif['address']

0 comments on commit 568f9b3

Please sign in to comment.