API call is broken: /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Melange |
Invalid
|
Undecided
|
Unassigned |
Bug Description
ubuntu@
ip_blocks:
- broadcast: 10.222.222.255
cidr: 10.222.222.0/24
created_at: '2012-03-
dns1: 8.8.4.4
dns2: 8.8.4.4
gateway: 10.222.222.1
id: d7313456-
netmask: 255.255.255.0
network_id: c8a5df0e-
parent_id: null
policy_id: null
tenant_id: default
type: private
updated_at: '2012-03-
ubuntu@
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
GET /v1.0/ipam/
HTTP/1.1 500 Internal Server Error
Content-Length: 195
Content-Type: application/json; charset=UTF-8
Date: Sat, 10 Mar 2012 12:44:45 GMT
Connection: close
{"InternalServe
2012-03-10 13:44:45 DEBUG [routes.middleware] Matched GET /ipam/tenants/
2012-03-10 13:44:45 DEBUG [routes.middleware] Route path: '/ipam/
2012-03-10 13:44:45 DEBUG [routes.middleware] Match dict: {'action': u'index', 'tenant_id': u'default', 'controller': <melange.
2012-03-10 13:44:45 DEBUG [wsgi] Empty body provided in request
2012-03-10 13:44:45 ERROR [melange.wsgi] 'NoneType' object has no attribute 'tenant_id'
Traceback (most recent call last):
File "/usr/lib/
**action_args)
File "/usr/lib/
return self.dispatch(
File "/usr/lib/
return method(*args, **kwargs)
File "/usr/lib/
return self._paginated
File "/usr/lib/
collection = [element.data() for element in elements]
File "/usr/lib/
data[
AttributeError: 'NoneType' object has no attribute 'tenant_id'
Changed in melange: | |
status: | Incomplete → Invalid |
I cannot reproduce this with master, can you confirm it and provide a reproducible case?
$ curl --stderr /dev/null -H 'Content-type: application/json' -XPOST -d '{"ip_block": {"type": "private", "cidr": "10.1.1.0/24"}}' http:// localhost: 9898/v1. 0/ipam/ tenants/ default/ ip_blocks | python -m json.tool
"broadcast" : "10.1.1.255",
"created_ at": "2012-03- 21T03:05: 01", 242c-401c- 854c-a2655ff5c3 aa",
"network_ id": null,
"parent_ id": null,
"policy_ id": null,
"tenant_ id": "default",
"updated_ at": "2012-03- 21T03:05: 01"
{
"ip_block": {
"cidr": "10.1.1.0/24",
"dns1": "8.8.8.8",
"dns2": "8.8.4.4",
"gateway": null,
"id": "a78ca80c-
"netmask": "255.255.255.0",
"type": "private",
}
}
$ curl --stderr /dev/null -H 'Content-type: applicatoin/json' -XGET http:// localhost: 9898/v1. 0/ipam/ tenants/ default/ ip_blocks/ a78ca80c- 242c-401c- 854c-a2655ff5c3 aa/ip_addresses | python -m json.tool
{
"ip_addresses": []
}
$ curl --stderr /dev/null -XPOST -H 'Content-type: application/json' -d '{"ip_address": {"interface_id": "vifid"}}' http:// localhost: 9898/v1. 0/ipam/ tenants/ default/ ip_blocks/ a78ca80c- 242c-401c- 854c-a2655ff5c3 aa/ip_addresses | python -m json.tool
"created_ at": "2012-03- 21T03:05: 57", de75-4a9e- a62a-ee150851fc 58",
"interface_ id": "vifid",
"ip_block_ id": "a78ca80c- 242c-401c- 854c-a2655ff5c3 aa",
"updated_ at": "2012-03- 21T03:05: 57",
"used_ by_device" : null,
"used_ by_tenant" : "default",
{
"ip_address": {
"address": "10.1.1.0",
"id": "d29a173d-
"version": 4
}
}
$ curl --stderr /dev/null -H 'Content-type: applicatoin/json' -XGET http:// localhost: 9898/v1. 0/ipam/ tenants/ default/ ip_blocks/ a78ca80c- 242c-401c- 854c-a2655ff5c3 aa/ip_addresses | python -m json.tool
"address" : "10.1.1.0",
"created_ at": "2012-03- 21T03:05: 57", de75-4a9e- a62a-ee150851fc 58",
"interface _id": "vifid",
"ip_ block_id" : "a78ca80c- 242c-401c- 854c-a2655ff5c3 aa",
"updated_ at": "2012-03- 21T03:05: 57",
"used_ by_device" : null,
"used_ by_tenant" : "default",
"version" : 4
{
"ip_addresses": [
{
"id": "d29a173d-
}
]
}