summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-02-20 13:24:39 +0000
committerGerrit Code Review <review@openstack.org>2013-02-20 13:24:39 +0000
commit5b7747e31a885d92c558022155e6dc75c19ab144 (patch)
tree7340a99601dd4800df6d8868d9dcc4a61cd5b04e /nova/api
parent3f40de459cccb849ee892dad58ccba846a1149f2 (diff)
parenta28d8e17d9a482b1c473e2deab6083a903cbf204 (diff)
downloadnova-5b7747e31a885d92c558022155e6dc75c19ab144.tar.gz
nova-5b7747e31a885d92c558022155e6dc75c19ab144.tar.xz
nova-5b7747e31a885d92c558022155e6dc75c19ab144.zip
Merge "Fix network list and show with quantum."
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/os_networks.py2
-rw-r--r--nova/api/openstack/compute/contrib/os_tenant_networks.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/nova/api/openstack/compute/contrib/os_networks.py b/nova/api/openstack/compute/contrib/os_networks.py
index d1d172686..bef2c3d1f 100644
--- a/nova/api/openstack/compute/contrib/os_networks.py
+++ b/nova/api/openstack/compute/contrib/os_networks.py
@@ -46,7 +46,7 @@ def network_dict(context, network):
# are only visible if they are an admin.
if context.is_admin:
fields += admin_fields
- result = dict((field, network[field]) for field in fields)
+ result = dict((field, network.get(field)) for field in fields)
if 'uuid' in network:
result['id'] = network['uuid']
return result
diff --git a/nova/api/openstack/compute/contrib/os_tenant_networks.py b/nova/api/openstack/compute/contrib/os_tenant_networks.py
index 9848d2320..c22e64b1f 100644
--- a/nova/api/openstack/compute/contrib/os_tenant_networks.py
+++ b/nova/api/openstack/compute/contrib/os_tenant_networks.py
@@ -64,9 +64,9 @@ authorize = extensions.extension_authorizer('compute', 'os-tenant-networks')
def network_dict(network):
- return {"id": network.get("uuid") or network["id"],
- "cidr": network["cidr"],
- "label": network["label"]}
+ return {"id": network.get("uuid") or network.get("id"),
+ "cidr": network.get("cidr"),
+ "label": network.get("label")}
class NetworkController(object):
@@ -108,7 +108,7 @@ class NetworkController(object):
network = self.network_api.get(context, id)
except exception.NetworkNotFound:
raise exc.HTTPNotFound(_("Network not found"))
- return network_dict(network)
+ return {'network': network_dict(network)}
def delete(self, req, id):
context = req.environ['nova.context']