diff options
| author | Dan Wendlandt <dan@nicira.com> | 2011-08-26 15:57:31 -0700 |
|---|---|---|
| committer | Dan Wendlandt <dan@nicira.com> | 2011-08-26 15:57:31 -0700 |
| commit | 6f8f9c7b829bf1654305d22745ac2ea1d4dcc089 (patch) | |
| tree | acfc0fcee30530e08eaea59b22f456199ca50411 | |
| parent | 87a5fefe5b0e3379ef93fede0750ddd76dd3c20d (diff) | |
| parent | 3a91fa89ea23d22cd34336aa9281a439579d4ce0 (diff) | |
merge changes from brad due to recent quantum API changes
| -rw-r--r-- | nova/network/quantum/client.py | 3 | ||||
| -rw-r--r-- | nova/network/quantum/manager.py | 3 | ||||
| -rw-r--r-- | nova/network/quantum/quantum_connection.py | 6 |
3 files changed, 7 insertions, 5 deletions
diff --git a/nova/network/quantum/client.py b/nova/network/quantum/client.py index b57294c55..613369c7d 100644 --- a/nova/network/quantum/client.py +++ b/nova/network/quantum/client.py @@ -169,7 +169,8 @@ class Client(object): httplib.CREATED, httplib.ACCEPTED, httplib.NO_CONTENT): - return self.deserialize(data, status_code) + if data is not None and len(data): + return self.deserialize(data, status_code) else: raise Exception("Server returned error: %s" % res.read()) diff --git a/nova/network/quantum/manager.py b/nova/network/quantum/manager.py index e49d0cfdc..79bb65939 100644 --- a/nova/network/quantum/manager.py +++ b/nova/network/quantum/manager.py @@ -119,7 +119,8 @@ class QuantumManager(manager.FlatManager): def get_instance_nw_info(self, context, instance_id, instance_type_id, host): network_info = [] - project_id = context.project_id + instance = db.instance_get(context, instance_id) + project_id = instance.project_id admin_context = context.elevated() vifs = db.virtual_interface_get_by_instance(admin_context, diff --git a/nova/network/quantum/quantum_connection.py b/nova/network/quantum/quantum_connection.py index 7a96d23fd..c0eaad1fd 100644 --- a/nova/network/quantum/quantum_connection.py +++ b/nova/network/quantum/quantum_connection.py @@ -67,9 +67,9 @@ class QuantumClientConnection: (interface_id, net_id, tenant_id)) port_data = {'port': {'port-state': 'ACTIVE'}} resdict = self.client.create_port(net_id, port_data, tenant=tenant_id) - port_id = resdict["ports"]["port"]["id"] + port_id = resdict["port"]["id"] - attach_data = {'port': {'attachment-id': interface_id}} + attach_data = {'attachment': {'id': interface_id}} self.client.attach_resource(net_id, port_id, attach_data, tenant=tenant_id) @@ -92,6 +92,6 @@ class QuantumClientConnection: port_id = p["id"] port_get_resdict = self.client.show_port_attachment(net_id, port_id, tenant=tenant_id) - if attachment_id == port_get_resdict["attachment"]: + if attachment_id == port_get_resdict["attachment"]["id"]: return (net_id, port_id) return (None, None) |
