Failed to execute nova list network if using qpid
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| OpenStack Compute (nova) |
High
|
Zhi Yan Liu |
Bug Description
ERROR: "string indices must be integers, not str" returned by "nova
network-list"
## Appearance:
1. Setup OpenStack cloud.
2. Create networks
3. List all network by nova CLI but meet the error:
[root@firstbox ~]# nova network-list
ERROR: string indices must be integers, not str
## Environment:
OpenStack: ibm-folsom
QPidd: 0.18
qpid-python: 0.18
## Analysis:
1. From the nova CLI verbose message, I found all the datetime type
filed in the nova-api response body are all wrong, as below log, this
situation cased nova client (nova-pythonclient) can not parse that
payload data into python dictionary structure by the json parser library
(novaclient/
raise "string indices must be integers, not str" exception message to
end user since "body" object is not a vaild dictionary object.
RESP:{'status': '200', 'content-length': '682', 'content-location':
u'http://
'x-compute-
'date': 'Wed, 12 Dec 2012 10:19:11 GMT', 'content-type':
'application/
"vpn_public_port": null, "dhcp_start": "172.0.0.2", "bridge_interface":
null, "updated_at": timestamp(
"491de13b-
null, "gateway": "172.0.0.1", "rxtx_base": null, "label": "demonet",
"priority": null, "project_id": null, "vpn_private_
"deleted": false, "vlan": null, "broadcast": "172.0.0.255", "netmask":
"255.255.255.0", "injected": false, "cidr": "172.0.0.0/24",
"created_at": timestamp(
null, "netmask_v6": null, "dns1": "8.8.4.4"}]}
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Russell Bryant (russellb) |
Changed in nova: | |
status: | Confirmed → In Progress |
Reviewed: https:/
Committed: http://
Submitter: Jenkins
Branch: master
commit 1259395061005b7
Author: Russell Bryant <email address hidden>
Date: Wed Dec 12 10:29:13 2012 -0500
Ensure datetimes can be properly serialized.
The nova-network manager was returning db models from methods invoked
via rpc.call(). These db models include non-primitive types that can
not be properly serialized (namely datetime objects). Use
to_primitive() to ensure that the data gets serialized properly.
Fix bug 1089430.
Change-Id: I019504cf68b2d4
Changed in nova: | |
status: | In Progress → Fix Committed |
hill (yuyuehill) wrote : | #3 |
It can fix the nova network list problem , but i got nova network-show failed for the same problem.
This makes me worry since we don't have the test cases to verify this. And there are a lot of places that need to handle
since it happens whey across rpc call. I may keep finding the similar issues on other api calls when i using
qpid with openstack.
any idea to solve this ?
Michael Fork (mjfork) wrote : | #4 |
While this did work for network-list, network-show also fails.
# nova network-show a230db28-
ERROR: string indices must be integers, not str
Changed in nova: | |
status: | Fix Committed → New |
status: | New → Confirmed |
Yaguang Tang (heut2008) wrote : | #5 |
@Michael
I tested that with the latest trunk code, nova network-show works well, can you try to test it again?
Changed in nova: | |
assignee: | Russell Bryant (russellb) → Zhi Yan Liu (lzy-dev) |
status: | Confirmed → In Progress |
Qiu Yu (unicell) wrote : | #6 |
Following patch should fix the network-show issue
diff --git a/nova/
index b6b2e41..80bffde 100644
--- a/nova/
+++ b/nova/
@@ -1775,7 +1775,7 @@ class NetworkManager(
@wrap_
def get_network(self, context, network_uuid):
network = self.db.
- return dict(network.
+ return jsonutils.
@wrap_
def get_all_
Zhi Yan Liu (lzy-dev) wrote : | #7 |
Yes, that is what i did and I have verified in my environment.
Fix proposed to branch: master
Review: https:/
Fix proposed to branch: stable/folsom
Review: https:/
Fix proposed to branch: stable/folsom
Review: https:/
Changed in nova: | |
status: | In Progress → Fix Committed |
Reviewed: https:/
Committed: http://
Submitter: Jenkins
Branch: master
commit e12a6f61bb3d9ce
Author: zhiyanliu <email address hidden>
Date: Mon Dec 24 11:22:45 2012 +0800
Ensure datetimes can be properly serialized.
The nova-network manager was returning db models from methods invoked
via rpc.call(). These db models include non-primitive types that can
not be properly serialized (namely datetime objects). Use
to_primitive() to ensure that the data gets serialized properly.
Fix bug: #1089430
Change-Id: I0519e88444b8fc
Signed-off-by: zhiyanliu <email address hidden>
Changed in nova: | |
milestone: | none → grizzly-2 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | grizzly-2 → 2013.1 |
no longer affects: | nova/folsom |
Fix proposed to branch: master /review. openstack. org/17948
Review: https:/