Empty 'tenant_id' field in cloudkitty hashmap-mapping-create

Bug #1616805 reported by Luka Peschke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloudkitty
Fix Committed
Undecided
Luka Peschke

Bug Description

When I try to create a new mapping from command line, the 'tenat_id' field in the request body is always empty, even whit the -p (project-id) option in the command line:

cloudkitty -d -v hashmap-mapping-create -s cc15e3ac-650a-495c-a9fd-2e830eb73d2e -p c862f0bec0094fa29d51b77b9bdb0fa2 -c 2
DEBUG (extension) found extension EntryPoint.parse('hashmap = cloudkittyclient.v1.rating.hashmap.extension:Extension')
DEBUG (extension) found extension EntryPoint.parse('pyscripts = cloudkittyclient.v1.rating.pyscripts.extension:Extension')
DEBUG (extension) found extension EntryPoint.parse('hashmap = cloudkittyclient.v1.rating.hashmap.extension:Extension')
DEBUG (extension) found extension EntryPoint.parse('pyscripts = cloudkittyclient.v1.rating.pyscripts.extension:Extension')
DEBUG (session) REQ: curl -g -i -X GET http://192.168.83.189:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
INFO (connectionpool) Starting new HTTP connection (1): 192.168.83.189
DEBUG (connectionpool) "GET /v2.0 HTTP/1.1" 200 348
DEBUG (session) RESP: [200] Date: Thu, 25 Aug 2016 08:42:59 GMT Server: Apache/2.4.7 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-26e99843-dc56-43bc-8abe-d533eb365789 Content-Length: 348 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: application/json
RESP BODY: {"version": {"status": "deprecated", "updated": "2016-08-04T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://192.168.83.189/identity/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}

DEBUG (v2) Making authentication request to http://192.168.83.189/identity/v2.0/tokens
INFO (connectionpool) Starting new HTTP connection (1): 192.168.83.189
DEBUG (connectionpool) "POST /identity/v2.0/tokens HTTP/1.1" 200 3811
DEBUG (client) REQ: curl -g -i -X 'POST' 'http://192.168.83.189:8889/v1/rating/module_config/hashmap/mappings' -H 'User-Agent: cloudkittyclient.openstack.common.apiclient' -H 'Content-Type: application/json' -H 'X-Auth-Token: {SHA1}ee04c26e8538370497df6f96e0c5cefd3877f405'
DEBUG (client) REQ BODY: {"tenant_id": "", "cost": "2", "service_id": "cc15e3ac-650a-495c-a9fd-2e830eb73d2e"}

INFO (connectionpool) Starting new HTTP connection (1): 192.168.83.189
DEBUG (connectionpool) "POST /v1/rating/module_config/hashmap/mappings HTTP/1.1" 400 137
DEBUG (client) RESP: [400] {'Date': 'Thu, 25 Aug 2016 08:43:00 GMT', 'Content-Length': '137', 'Content-Type': 'application/json; charset=UTF-8', 'x-openstack-request-id': 'req-e1ae182a-b36e-4989-90be-b792af0188d3', 'Server': 'WSGIServer/0.1 Python/2.7.6'}

DEBUG (client) RESP BODY: {"debuginfo": null, "faultcode": "Client", "faultstring": "Invalid input for field/attribute tenant_id. Value: ''. Invalid UUID, got ''"}

DEBUG (client) Request returned failure status: 400
Traceback (most recent call last):
  File "/usr/local/bin/cloudkitty", line 10, in <module>
    sys.exit(main())
  File "/opt/stack/python-cloudkittyclient/cloudkittyclient/shell.py", line 315, in main
    CloudkittyShell().main(args)
  File "/opt/stack/python-cloudkittyclient/cloudkittyclient/shell.py", line 264, in main
    args.func(client, args)
  File "/opt/stack/python-cloudkittyclient/cloudkittyclient/v1/rating/hashmap/shell.py", line 134, in _wrapped
    return func(*args, **kwargs)
  File "/opt/stack/python-cloudkittyclient/cloudkittyclient/v1/rating/hashmap/shell.py", line 162, in do_hashmap_mapping_create
    out = cc.hashmap.mappings.create(**fields)
  File "/opt/stack/python-cloudkittyclient/cloudkittyclient/common/base.py", line 113, in create
    self.build_url(**kwargs), kwargs)
  File "/opt/stack/python-cloudkittyclient/cloudkittyclient/openstack/common/apiclient/base.py", line 178, in _post
    body = self.client.post(url, json=json).json()
  File "/opt/stack/python-cloudkittyclient/cloudkittyclient/openstack/common/apiclient/client.py", line 361, in post
    return self.client_request("POST", url, **kwargs)
  File "/opt/stack/python-cloudkittyclient/cloudkittyclient/openstack/common/apiclient/client.py", line 348, in client_request
    self, method, url, **kwargs)
  File "/opt/stack/python-cloudkittyclient/cloudkittyclient/openstack/common/apiclient/client.py", line 264, in client_request
    method, self.concat_url(endpoint, url), **kwargs)
  File "/opt/stack/python-cloudkittyclient/cloudkittyclient/openstack/common/apiclient/client.py", line 204, in request
    raise exceptions.from_response(resp, method, url)
cloudkittyclient.openstack.common.apiclient.exceptions.BadRequest: Bad Request (HTTP 400) (Request-ID: req-e1ae182a-b36e-4989-90be-b792af0188d3)

Changed in cloudkitty:
assignee: nobody → Luka Peschke (luka-peschke)
Changed in cloudkitty:
status: New → Confirmed
Changed in cloudkitty:
status: Confirmed → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-cloudkittyclient 0.6.0

This issue was fixed in the openstack/python-cloudkittyclient 0.6.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-cloudkittyclient 1.0.0

This issue was fixed in the openstack/python-cloudkittyclient 1.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.