Hello everyone.

I'm working on openstack application. It should works with large range of openstacks (at least from Havana till Pica+) and works on large range of keystoneauth1 clients (at least from Ubuntu's trusty distro versions till Xenial+). I want it to work with any combination of available versions.

I use following steps:

1. Autodiscovery of supported versions:

def _find_local_versions():
        version_filter = partial(re.find, 'v\d+')
        return filter(version_filter, dir(keystoneauth1.identity))

2. Discovery of remote versions:

        r = requests.get(keystone.auth_url)
        versions = map(lambda x: x['id'], r.json()['versions']['values'])

3. Matching them together (plus my own application's list of supported versions).

4. Use separate code for 'v2' and 'v3' with auto-conversion between 'tenant_name' and 'project_name' for keystoneauth1.identity.v2/v3

Is this a proper way to do it? Is here a better way to do this? Thanks.

_______________________________________________
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to     : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack

Reply via email to