Container missing 'name' issues 2 calls for container get via CLI

Bug #1540691 reported by Arun Kant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Barbican
Won't Fix
Low
Unassigned

Bug Description

When I create a container without --name argument, then 'barbican container get' call results in duplicate GET container calls.

2 call is unnecessary if we can correct this logic related to reading 'name' property https://github.com/openstack/python-barbicanclient/blob/master/barbicanclient/containers.py#L127

stack@padawan-ccp-c0-m1-mgmt:~$ barbican -vvvv container get http://192.168.245.9:9311/v1/containers/a2ac2a8e-a7e6-4118-bc13-adf7d6304f3d
Creating Client object
found extension EntryPoint.parse('table = cliff.formatters.table:TableFormatter')
found extension EntryPoint.parse('json = cliff.formatters.json_format:JSONFormatter')
found extension EntryPoint.parse('shell = cliff.formatters.shell:ShellFormatter')
found extension EntryPoint.parse('value = cliff.formatters.value:ValueFormatter')
found extension EntryPoint.parse('yaml = cliff.formatters.yaml_format:YAMLFormatter')
Getting container - Container href: http://redacted: 9311/v1/containers/a2ac2a8e-a7e6-4118-bc13-adf7d6304f3d
Making authentication request to http://{redacted}:35357/v3/auth/tokens
Starting new HTTP connection (1): {redacted_host_name}
"POST /v3/auth/tokens HTTP/1.1" 201 1768
REQ: curl -g -i -X GET http://192.168.245.9:9311/v1/containers/a2ac2a8e-a7e6-4118-bc13-adf7d6304f3d -H "User-Agent: python-keystoneclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}a00ed3a32bcb4cadfa4dee2fb53d1f02bcad0ee5"
Starting new HTTP connection (1): 192.168.245.9
"GET /v1/containers/a2ac2a8e-a7e6-4118-bc13-adf7d6304f3d HTTP/1.1" 200 411
RESP: [200] Content-Length: 411 Content-Type: application/json; charset=UTF-8 x-openstack-request-id: req-2dc238ca-39bd-41a1-a909-f528d4f51c03
RESP BODY: {"status": "ACTIVE", "updated": "2016-02-02T00:36:45", "name": null, "consumers": [], "created": "2016-02-02T00:36:45", "container_ref": "http://192.168.245.9:9311/v1/containers/a2ac2a8e-a7e6-4118-bc13-adf7d6304f3d", "creator_id": "5b8806ff8686418590002056b6cdcc7f", "secret_refs": [{"secret_ref": "http://192.168.245.9:9311/v1/secrets/2c99be5d-e540-4d4c-8517-bf6a3cb7aa03", "name": "name"}], "type": "generic"}

Response status 200
Getting secret - Secret href: http://192.168.245.9:9311/v1/secrets/2c99be5d-e540-4d4c-8517-bf6a3cb7aa03
Getting container - Container href: http://192.168.245.9:9311/v1/containers/a2ac2a8e-a7e6-4118-bc13-adf7d6304f3d
REQ: curl -g -i -X GET http://192.168.245.9:9311/v1/containers/a2ac2a8e-a7e6-4118-bc13-adf7d6304f3d -H "User-Agent: python-keystoneclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}a00ed3a32bcb4cadfa4dee2fb53d1f02bcad0ee5"
"GET /v1/containers/a2ac2a8e-a7e6-4118-bc13-adf7d6304f3d HTTP/1.1" 200 411
RESP: [200] Content-Length: 411 Content-Type: application/json; charset=UTF-8 x-openstack-request-id: req-34e4052f-77ac-4339-97d5-e3f5ff678fce
RESP BODY: {"status": "ACTIVE", "updated": "2016-02-02T00:36:45", "name": null, "consumers": [], "created": "2016-02-02T00:36:45", "container_ref": "http://192.168.245.9:9311/v1/containers/a2ac2a8e-a7e6-4118-bc13-adf7d6304f3d", "creator_id": "5b8806ff8686418590002056b6cdcc7f", "secret_refs": [{"secret_ref": "http://192.168.245.9:9311/v1/secrets/2c99be5d-e540-4d4c-8517-bf6a3cb7aa03", "name": "name"}], "type": "generic"}

Response status 200
+----------------+--------------------------------------------------------------------------------+
| Field | Value |
+----------------+--------------------------------------------------------------------------------+
| Container href | http://192.168.245.9:9311/v1/containers/a2ac2a8e-a7e6-4118-bc13-adf7d6304f3d |
| Name | None |
| Created | 2016-02-02 00:36:45+00:00 |
| Status | ACTIVE |
| Type | generic |
| Secrets | name=http://192.168.245.9:9311/v1/secrets/2c99be5d-e540-4d4c-8517-bf6a3cb7aa03 |
| Consumers | None |
+----------------+--------------------------------------------------------------------------------+

Arun Kant (arukant)
description: updated
Revision history for this message
ting.wang (bx-wang) wrote :

I reported in python-barbican a month ago.
please see: https://bugs.launchpad.net/python-barbicanclient/+bug/1531403
the same problem, right?

Changed in barbican:
assignee: nobody → Sharat Sharma (sharat-sharma)
Changed in barbican:
assignee: Sharat Sharma (sharat-sharma) → Douglas Mendizábal (dougmendizabal)
Revision history for this message
Kaitlin Farr (kaitlin-farr) wrote :

This bug is related to the logic here: https://github.com/openstack/python-barbicanclient/blob/master/barbicanclient/v1/containers.py#L125-L129

If there is no "name" attribute, the client tries to load the secret again. Maybe we can just remove the _reload call?

Changed in barbican:
assignee: Douglas Mendizábal (dougmendizabal) → nobody
importance: Undecided → Low
Revision history for this message
Grzegorz Grasza (xek) wrote :

Closing out bugs created before migration to StoryBoard. Please re-open if you are of the opinion it is still current.

Changed in barbican:
status: New → Won't Fix
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.