[openstack-dev] [savanna] using keystone client

Dolph Mathews dolph.mathews at gmail.com
Tue Oct 8 12:29:21 UTC 2013


On Tue, Oct 8, 2013 at 6:50 AM, Jon Maron <jmaron at hortonworks.com> wrote:

>
> On Oct 7, 2013, at 10:02 PM, Dolph Mathews <dolph.mathews at gmail.com>
> wrote:
>
>
> On Mon, Oct 7, 2013 at 5:57 PM, Jon Maron <jmaron at hortonworks.com> wrote:
>
>> Hi,
>>
>>   I'm trying to use the keystone client code in savanna/utils/openstack
>> but my attempt to sue it yield:
>>
>>  'Api v2.0 endpoint not found in service identity'
>>
>>
> This sounds like the service catalog for keystone itself either isn't
> configured, or isn't configured properly (with /v2.0/ endpoints). What does
> your `keystone service-list` and `keystone endpoint-list` look like?
>
>
> they look fine:
>

Agree, AFAICT. My next guess would be that the credentials you're using to
connect to keystone do not specify a tenant / project - without one, the
client won't get a service catalog at all.


>
> [root at cn081 ~(keystone_admin)]# keystone endpoint-list
>
> +----------------------------------+-----------+-----------------------------------------------+-----------------------------------------------+------------------------------------------+----------------------------------+
> |                id                |   region  |
> publicurl                   |                  internalurl
>  |                 adminurl                 |            service_id
>    |
>
> +----------------------------------+-----------+-----------------------------------------------+-----------------------------------------------+------------------------------------------+----------------------------------+
> | 1d093399f00246b895ce8507c1b24b7b | RegionOne |
> http://172.18.0.81:9292            |            http://172.18.0.81:9292
>          |         http://172.18.0.81:9292          |
> dce5859bb86e4d76a3688d2bf70cad33 |
> | 48f8a5bcde0747c08b149f36144a018d | RegionOne |
> http://172.18.0.81:8080            |            http://172.18.0.81:8080
>          |         http://172.18.0.81:8080          |
> 8e83541c4add45058a83609345f0f7f5 |
> | 6223abce129948539d413adb0f392f66 | RegionOne |
> http://172.18.0.81:8080/v1/AUTH_%(tenant_id)s |
> http://172.18.0.81:8080/v1/AUTH_%(tenant_id)s |
> http://172.18.0.81:8080/         | fe922aac92ac4e048fb02346a3176827 |
> | 64740640bb824c2493cc456c76d9c4e8 | RegionOne |
> http://172.18.0.81:8776/v1/%(tenant_id)s   |
> http://172.18.0.81:8776/v1/%(tenant_id)s   |
> http://172.18.0.81:8776/v1/%(tenant_id)s |
> a13bf1f4319a4b78984cbf80ce4a1879 |
> | 8948845ea83940f7a04f2d6ec35da7ab | RegionOne |
> http://172.18.0.81:8774/v2/%(tenant_id)s   |
> http://172.18.0.81:8774/v2/%(tenant_id)s   |
> http://172.18.0.81:8774/v2/%(tenant_id)s |
> 4480cd65dc6a4858b5b237cc4c30761e |
> | cd1420cfcc59467ba76bfc32f79f9c77 | RegionOne |
> http://172.18.0.81:9696/           |            http://172.18.0.81:9696/          |
> http://172.18.0.81:9696/         | 399854c740b649a6935d6568d3ffe497 |
> | d860fe39b41646be97582de9cef8c91c | RegionOne |
> http://172.18.0.81:5000/v2.0         |
> http://172.18.0.81:5000/v2.0         |      http://172.18.0.81:35357/v2.0      | b4b2cc6d2db2493eafe2ccbb649b491e |
> | edc75652965a4bd2854c194c213ea395 | RegionOne |
> http://172.18.0.81:8773/services/Cloud    |
> http://172.18.0.81:8773/services/Cloud    |
> http://172.18.0.81:8773/services/Admin  |
> dea2442916144ef18cf64d2111f1d906 |
>
> +----------------------------------+-----------+-----------------------------------------------+-----------------------------------------------+------------------------------------------+----------------------------------+
> [root at cn081 ~(keystone_admin)]# keystone service-list
>
> +----------------------------------+----------+--------------+--------------------------------+
> |                id                |   name   |     type     |
>  description           |
>
> +----------------------------------+----------+--------------+--------------------------------+
> | a13bf1f4319a4b78984cbf80ce4a1879 |  cinder  |    volume    |
> Cinder Service         |
> | dce5859bb86e4d76a3688d2bf70cad33 |  glance  |    image     |
>  Openstack Image Service     |
> | b4b2cc6d2db2493eafe2ccbb649b491e | keystone |   identity   |   OpenStack
> Identity Service   |
> | 4480cd65dc6a4858b5b237cc4c30761e |   nova   |   compute    |   Openstack
> Compute Service    |
> | dea2442916144ef18cf64d2111f1d906 | nova_ec2 |     ec2      |
>  EC2 Service           |
> | 399854c740b649a6935d6568d3ffe497 | quantum  |   network    |   Quantum
> Networking Service   |
> | fe922aac92ac4e048fb02346a3176827 |  swift   | object-store | Openstack
> Object-Store Service |
> | 8e83541c4add45058a83609345f0f7f5 | swift_s3 |      s3      |
>  Openstack S3 Service      |
>
> +----------------------------------+----------+--------------+--------------------------------+
>
>
>
>
>>   An code sample:
>>
>> from savanna.utils.openstack import keystone
>>
>> . . .
>>       service_id = next((service.id for service in
>>                        keystone.client().services.list()
>>                        if 'quantum' == service.name), None)
>>
>
> I don't really know what the context of this code is, but be aware that it
> requires "admin" access to keystone and is not interacting with a
> representation of the catalog that normal users see.
>
>
> I'm leveraging a keystone client available in the savanna code base so was
> hoping for some insight from the developers.
>
> It's also not particularly reliable to identify services by name --
> instead, use they're type (type="network", for quantum I believe), as a
> deployer could name a network service as "Quantum" or "Neutron" or
> "neutron" or "My Awesome Neutron"... but in any case, the type should still
> be "network".
>
> /me facepalm: s/they're/their/


>
> Thanks - will do.
>
>
>
>>
>>   Thanks for the help!
>>
>> -- Jon
>>
>>
>> --
>> CONFIDENTIALITY NOTICE
>> NOTICE: This message is intended for the use of the individual or entity
>> to
>> which it is addressed and may contain information that is confidential,
>> privileged and exempt from disclosure under applicable law. If the reader
>> of this message is not the intended recipient, you are hereby notified
>> that
>> any printing, copying, dissemination, distribution, disclosure or
>> forwarding of this communication is strictly prohibited. If you have
>> received this communication in error, please contact the sender
>> immediately
>> and delete it from your system. Thank You.
>>
>> _______________________________________________
>> OpenStack-dev mailing list
>> OpenStack-dev at lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>
>
>
>
> --
>
> -Dolph
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
>
> CONFIDENTIALITY NOTICE
> NOTICE: This message is intended for the use of the individual or entity
> to which it is addressed and may contain information that is confidential,
> privileged and exempt from disclosure under applicable law. If the reader
> of this message is not the intended recipient, you are hereby notified that
> any printing, copying, dissemination, distribution, disclosure or
> forwarding of this communication is strictly prohibited. If you have
> received this communication in error, please contact the sender immediately
> and delete it from your system. Thank You.
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>


-- 

-Dolph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20131008/2d6e389b/attachment.html>


More information about the OpenStack-dev mailing list