2012-04-26 20:10:55 |
James Kyle |
description |
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
ii glance 2012.1-0ubuntu2
ii glance-api 2012.1-0ubuntu2
ii glance-client 2012.1-0ubuntu2
ii glance-common 2012.1-0ubuntu2
ii glance-registry 2012.1-0ubuntu2
ii keystone 2012.1-0ubuntu1
ii python-glance 2012.1-0ubuntu2
ii python-keystone 2012.1-0ubuntu1
ii python-keystoneclient 2012.1-0ubuntu1
Behavior: Glance throws a 404 object not found error unless os_auth_token is retrieved manually and explicitly passed.
Environment:
% env | grep "OS\_"
OS_REGION_NAME=myregion
OS_PASSWORD=ospass
OS_AUTH_USER=myadmin
OS_AUTH_URL=http://127.0.0.1:5000/v2.0/
OS_USERNAME=myadmin
OS_TENANT_NAME=openstackDemo
Example:
% glance index
Failed to show index. Got error:
An object with the specified identifier was not found.
Details: 404 Not Found
The resource could not be found.
Retrieve auth token using same username and pass:
curl -d '{"auth": {"tenantName": "openstackDemo", "passwordCredentials": {"username": "myadmin", "password": "ospass"}}}' -H "Content-type: application/json" http://127.0.0.1:35357/v2.0/tokens | python -mjson.tool
"token": {
"expires": "2012-04-27T18:31:45Z",
"id": "25768987345c436fa031d8f16072cbc8",
"tenant": {
"description": "Default Tenant",
"enabled": true,
"id": "65d487cc8d034cbc9b88c7d8840533b3",
"name": "openstackDemo"
}
Now, use the token:
% glance --os_auth_token=25768987345c436fa031d8f16072cbc8 index
ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
92bb79d1-f7bb-48ea-a774-236fb2d5f268 tty-linux-ramdisk ari ari 96629
ecd759d8-3c06-43e2-97df-f0b193cc2141 tty-linux-kernel aki aki 4404752 |
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
ii glance 2012.1-0ubuntu2
ii glance-api 2012.1-0ubuntu2
ii glance-client 2012.1-0ubuntu2
ii glance-common 2012.1-0ubuntu2
ii glance-registry 2012.1-0ubuntu2
ii keystone 2012.1-0ubuntu1
ii python-glance 2012.1-0ubuntu2
ii python-keystone 2012.1-0ubuntu1
ii python-keystoneclient 2012.1-0ubuntu1
Behavior: Glance throws a 404 object not found error unless os_auth_token is retrieved manually and explicitly passed.
Environment:
% env | grep "OS\_"
OS_REGION_NAME=myregion
OS_PASSWORD=ospass
OS_AUTH_USER=myadmin
OS_AUTH_URL=http://127.0.0.1:5000/v2.0/
OS_USERNAME=myadmin
OS_TENANT_NAME=openstackDemo
Example:
% glance index
Failed to show index. Got error:
An object with the specified identifier was not found.
Details: 404 Not Found
The resource could not be found.
Retrieve auth token using same username and pass:
curl -d '{"auth": {"tenantName": "openstackDemo", "passwordCredentials": {"username": "myadmin", "password": "ospass"}}}' -H "Content-type: application/json" http://127.0.0.1:35357/v2.0/tokens | python -mjson.tool
"token": {
"expires": "2012-04-27T18:31:45Z",
"id": "25768987345c436fa031d8f16072cbc8",
"tenant": {
"description": "Default Tenant",
"enabled": true,
"id": "65d487cc8d034cbc9b88c7d8840533b3",
"name": "openstackDemo"
}
Now, use the token:
% glance --os_auth_token=25768987345c436fa031d8f16072cbc8 index
ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
92bb79d1-f7bb-48ea-a774-236fb2d5f268 tty-linux-ramdisk ari ari 96629
ecd759d8-3c06-43e2-97df-f0b193cc2141 tty-linux-kernel aki aki 4404752
====EDIT======
I inserted a print(self.auth_token) after glance.common.auth:243. The auth_body returns a valid token. If I pass that exact token to glance cli, query succeeds. |
|