implements service catalog

Bug #892148 reported by klmitch
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
High
Unassigned

Bug Description

Voila

Revision history for this message
klmitch (q-noreply) wrote :

For dashboard we used a method for getting the url for a service/class

    url_for('nova', 'internal')

Revision history for this message
klmitch (q-noreply) wrote :

You mean something like this in the ServiceCatalog class?

    def url_for(self, catalog_class, url):
        catalog = getattr(self, catalog_class)
        if catalog:
            return getattr(catalog, url + "_url")

Revision history for this message
klmitch (q-noreply) wrote :

yeah, something like that

Revision history for this message
klmitch (q-noreply) wrote :

One last thing that dashboard does: restore service catalog from session.

We put the service catalog and token (since both are returned from auth) into the user session. Then each request begins with constructing a nova/glance/keystone client using the token and the url retrieved from the service catalog.

Revision history for this message
klmitch (q-noreply) wrote :

This is just the start of refactoring the client to respect work with openstack auth ...

This allows the keystone management code (see #74) to work as:

    from novaclient import client
    conn = client.HTTPClient(USER, PASS, TENANT, KEYSTONE_URL)
    from novaclient import keystone
    kc = keystone.Client(conn)

but it should probably be more like:

    # user specifies either auth endpoint (expected)
    # - OR - service endpoint (not expected - since the endpoint has tenant)
    import novaclient
    api = novaclient.connect(USER, PASS, ENDPOINT, OPTIONAL_TENANT)
    # connect would talk to keystone, get the catalog
    # note: even in auth 1.0/1.1 you get back a "catalog" of storage & compute endpoints
    api.nova.servers.list()
    api.keystone.tenants.list()
    api.glance # should this use glance-client but pass the token?
    api.swift # should this use .....

I've pushed a branch that has start the keystone working as above ... thoughts on moving forward?

Revision history for this message
klmitch (q-noreply) wrote :

Sorry, this needs to get freshened up now that that proxy redirect branch has landed.

Revision history for this message
klmitch (q-noreply) wrote :

closing for now, 0x44 will resubmit.

Thierry Carrez (ttx)
affects: nova → python-novaclient
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.