Permalink
Browse files

allow empty network list to be requested

Change-Id: I776a429fb62e335e458f45466f0c362e1270e319
  • Loading branch information...
1 parent eb20c5a commit 55dd9aeb63831ffaf06e14fb84c977a6e25ccbc5 @tr3buchet tr3buchet committed Sep 14, 2012
Showing with 6 additions and 16 deletions.
  1. +2 −1 novaclient/v1_1/base.py
  2. +4 −15 tests/v1_1/test_shell.py
View
@@ -141,7 +141,8 @@ def _boot(self, resource_url, response_key, name, image, flavor,
bdm_dict['delete_on_termination'] = mapping_parts[3]
bdm.append(bdm_dict)
- if nics:
+ if nics is not None:
+ # NOTE(tr3buchet): nics can be an empty list
all_net_data = []
for nic_info in nics:
net_data = {}
View
@@ -82,6 +82,7 @@ def test_boot(self):
'imageRef': '1',
'min_count': 1,
'max_count': 1,
+ 'networks': [],
}},
)
@@ -97,6 +98,7 @@ def test_boot_metadata(self):
'metadata': {'foo': 'bar=pants', 'spam': 'eggs'},
'min_count': 1,
'max_count': 1,
+ 'networks': [],
}},
)
@@ -111,6 +113,7 @@ def test_boot_hints(self):
'imageRef': '1',
'min_count': 1,
'max_count': 1,
+ 'networks': [],
},
'os:scheduler_hints': {'a': 'b=c'},
},
@@ -152,6 +155,7 @@ def test_boot_files(self):
'imageRef': '1',
'min_count': 1,
'max_count': 1,
+ 'networks': [],
'personality': [
{'path': '/tmp/bar', 'contents': expected_file_data},
{'path': '/tmp/foo', 'contents': expected_file_data},
@@ -375,21 +379,6 @@ def test_flavor_create(self):
self.run_command("flavor-create flavorcreate "
"1234 512 10 1 --swap 1024 --ephemeral 10 "
"--is-public true")
-
- body = {
- "flavor": {
- "name": "flavorcreate",
- "ram": 512,
- "vcpus": 1,
- "disk": 10,
- "OS-FLV-EXT-DATA:ephemeral": 10,
- "id": 1234,
- "swap": 1024,
- "rxtx_factor": 1,
- "os-flavor-access:is_public": True,
- }
- }
-
self.assert_called('POST', '/flavors', pos=-3)
self.assert_called('GET', '/flavors/1', pos=-2)
self.assert_called('GET', '/flavors/1/os-extra_specs', pos=-1)

0 comments on commit 55dd9ae

Please sign in to comment.