diff options
| author | Zhi Yan Liu <zhiyanl@cn.ibm.com> | 2013-04-05 22:06:18 +0800 |
|---|---|---|
| committer | Zhi Yan Liu <zhiyanl@cn.ibm.com> | 2013-04-05 22:06:18 +0800 |
| commit | 9254403281fad200f871c5e6ff052dc79c739d6e (patch) | |
| tree | ecc2463ec282d4e8fc9efc56e531541f56803170 /nova/api | |
| parent | aa81b755287d68b77593371ef24b3d09dbe35ff8 (diff) | |
Correct network uuid field for os-network extension
"nova net-list" does not return network uuid even when the uuid is
available, and instead returns only the id. This is because the
"network_dict" function in the extension improperly uses "in" to check
for a Network model object. This also reduces compatibility in the API.
Fixes bug: 1162409
Change-Id: I30d4c8bfa37d89123f35ee8cc7c67f0e819262a7
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/os_networks.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nova/api/openstack/compute/contrib/os_networks.py b/nova/api/openstack/compute/contrib/os_networks.py index 2cea0e081..e8a5263aa 100644 --- a/nova/api/openstack/compute/contrib/os_networks.py +++ b/nova/api/openstack/compute/contrib/os_networks.py @@ -47,8 +47,9 @@ def network_dict(context, network): if context.is_admin: fields += admin_fields result = dict((field, network.get(field)) for field in fields) - if 'uuid' in network: - result['id'] = network['uuid'] + uuid = network.get('uuid') + if uuid: + result['id'] = uuid return result else: return {} |
