diff options
-rw-r--r-- | doc/source/vendor-support.rst | 17 | ||||
-rw-r--r-- | openstack-common.conf | 6 | ||||
-rw-r--r-- | os_client_config/__init__.py | 11 | ||||
-rw-r--r-- | os_client_config/cloud_config.py | 7 | ||||
-rw-r--r-- | os_client_config/config.py | 14 | ||||
-rw-r--r-- | os_client_config/constructors.json | 1 | ||||
-rw-r--r-- | os_client_config/defaults.json | 1 | ||||
-rw-r--r-- | os_client_config/tests/test_cloud_config.py | 3 | ||||
-rw-r--r-- | os_client_config/vendors/auro.json | 1 | ||||
-rw-r--r-- | os_client_config/vendors/conoha.json | 5 | ||||
-rw-r--r-- | os_client_config/vendors/datacentred.json | 3 | ||||
-rw-r--r-- | os_client_config/vendors/dreamhost.json | 3 | ||||
-rw-r--r-- | os_client_config/vendors/elastx.json | 3 | ||||
-rw-r--r-- | os_client_config/vendors/entercloudsuite.json | 3 | ||||
-rw-r--r-- | os_client_config/vendors/hp.json | 3 | ||||
-rw-r--r-- | os_client_config/vendors/ibmcloud.json | 13 | ||||
-rw-r--r-- | os_client_config/vendors/internap.json | 3 | ||||
-rw-r--r-- | os_client_config/vendors/ovh.json | 3 | ||||
-rw-r--r-- | os_client_config/vendors/runabove.json | 3 | ||||
-rw-r--r-- | os_client_config/vendors/ultimum.json | 3 |
20 files changed, 78 insertions, 28 deletions
diff --git a/doc/source/vendor-support.rst b/doc/source/vendor-support.rst index 8ae2f61..46c95d8 100644 --- a/doc/source/vendor-support.rst +++ b/doc/source/vendor-support.rst @@ -74,7 +74,7 @@ Kna1 Karlskrona, SE conoha ------ -https://identity.%(region_name)s.conoha.io/v2.0 +https://identity.%(region_name)s.conoha.io ============== ================ Region Name Human Name @@ -89,7 +89,7 @@ sjc1 San Jose, CA datacentred ----------- -https://compute.datacentred.io:5000/v2.0 +https://compute.datacentred.io:5000 ============== ================ Region Name Human Name @@ -159,6 +159,19 @@ region-b.geo-1 US East * Public IPv4 is provided via NAT with Neutron Floating IP * Volume API Version is 1 +ibmcloud +-------- + +https://identity.open.softlayer.com + +============== ================ +Region Name Human Name +============== ================ +london London, UK +============== ================ + +* Public IPv4 is provided via NAT with Neutron Floating IP + internap -------- diff --git a/openstack-common.conf b/openstack-common.conf deleted file mode 100644 index e8eb2aa..0000000 --- a/openstack-common.conf +++ /dev/null @@ -1,6 +0,0 @@ -[DEFAULT] - -# The list of modules to copy from oslo-incubator.git - -# The base module to hold the copy of openstack.common -base=os_client_config
\ No newline at end of file diff --git a/os_client_config/__init__.py b/os_client_config/__init__.py index ac585f2..52fcb85 100644 --- a/os_client_config/__init__.py +++ b/os_client_config/__init__.py @@ -14,6 +14,7 @@ import sys +from os_client_config import cloud_config from os_client_config.config import OpenStackConfig # noqa @@ -31,10 +32,10 @@ def simple_client(service_key, cloud=None, region_name=None): at OpenStack REST APIs with a properly configured keystone session. """ return OpenStackConfig().get_one_cloud( - cloud=cloud, region_name=region_name).get_session_client('compute') + cloud=cloud, region_name=region_name).get_session_client(service_key) -def make_client(service_key, constructor, options=None, **kwargs): +def make_client(service_key, constructor=None, options=None, **kwargs): """Simple wrapper for getting a client instance from a client lib. OpenStack Client Libraries all have a fairly consistent constructor @@ -44,6 +45,8 @@ def make_client(service_key, constructor, options=None, **kwargs): variables and clouds.yaml - and takes as **kwargs anything you'd expect to pass in. """ + if not constructor: + constructor = cloud_config._get_client(service_key) config = OpenStackConfig() if options: config.register_argparse_options(options, sys.argv, service_key) @@ -51,5 +54,5 @@ def make_client(service_key, constructor, options=None, **kwargs): else: parsed_options = None - cloud_config = config.get_one_cloud(options=parsed_options, **kwargs) - return cloud_config.get_legacy_client(service_key, constructor) + cloud = config.get_one_cloud(options=parsed_options, **kwargs) + return cloud.get_legacy_client(service_key, constructor) diff --git a/os_client_config/cloud_config.py b/os_client_config/cloud_config.py index f73da04..3b9bee9 100644 --- a/os_client_config/cloud_config.py +++ b/os_client_config/cloud_config.py @@ -305,7 +305,7 @@ class CloudConfig(object): endpoint_override = self.get_endpoint(service_key) if not interface_key: - if service_key == 'image': + if service_key in ('image', 'key-manager'): interface_key = 'interface' else: interface_key = 'endpoint_type' @@ -348,7 +348,10 @@ class CloudConfig(object): if 'endpoint' not in constructor_kwargs: endpoint = self.get_session_endpoint('identity') constructor_kwargs['endpoint'] = endpoint - constructor_args.append(version) + if service_key == 'key-manager': + constructor_kwargs['version'] = version + else: + constructor_args.append(version) return client_class(*constructor_args, **constructor_kwargs) diff --git a/os_client_config/config.py b/os_client_config/config.py index 7e56f61..378cd3b 100644 --- a/os_client_config/config.py +++ b/os_client_config/config.py @@ -19,6 +19,7 @@ import collections import copy import json import os +import sys import warnings import appdirs @@ -990,4 +991,15 @@ class OpenStackConfig(object): if __name__ == '__main__': config = OpenStackConfig().get_all_clouds() for cloud in config: - print(cloud.name, cloud.region, cloud.config) + print_cloud = False + if len(sys.argv) == 1: + print_cloud = True + elif len(sys.argv) == 3 and ( + sys.argv[1] == cloud.name and sys.argv[2] == cloud.region): + print_cloud = True + elif len(sys.argv) == 2 and ( + sys.argv[1] == cloud.name): + print_cloud = True + + if print_cloud: + print(cloud.name, cloud.region, cloud.config) diff --git a/os_client_config/constructors.json b/os_client_config/constructors.json index be44339..89c844c 100644 --- a/os_client_config/constructors.json +++ b/os_client_config/constructors.json @@ -3,6 +3,7 @@ "database": "troveclient.client.Client", "identity": "keystoneclient.client.Client", "image": "glanceclient.Client", + "key-manager": "barbicanclient.client.Client", "metering": "ceilometerclient.client.Client", "network": "neutronclient.neutron.client.Client", "object-store": "swiftclient.client.Connection", diff --git a/os_client_config/defaults.json b/os_client_config/defaults.json index 2ffb672..f501862 100644 --- a/os_client_config/defaults.json +++ b/os_client_config/defaults.json @@ -12,6 +12,7 @@ "image_api_use_tasks": false, "image_api_version": "2", "image_format": "qcow2", + "key_manager_api_version": "v1", "metering_api_version": "2", "network_api_version": "2", "object_store_api_version": "1", diff --git a/os_client_config/tests/test_cloud_config.py b/os_client_config/tests/test_cloud_config.py index 01581b1..9d60111 100644 --- a/os_client_config/tests/test_cloud_config.py +++ b/os_client_config/tests/test_cloud_config.py @@ -148,8 +148,7 @@ class TestCloudConfig(base.TestCase): self.assertEqual('volume', cc.get_service_type('volume')) self.assertEqual('http://compute.example.com', cc.get_endpoint('compute')) - self.assertEqual(None, - cc.get_endpoint('image')) + self.assertIsNone(cc.get_endpoint('image')) self.assertIsNone(cc.get_service_name('compute')) self.assertEqual('locks', cc.get_service_name('identity')) diff --git a/os_client_config/vendors/auro.json b/os_client_config/vendors/auro.json index 1e59f01..a9e709b 100644 --- a/os_client_config/vendors/auro.json +++ b/os_client_config/vendors/auro.json @@ -4,6 +4,7 @@ "auth": { "auth_url": "https://api.van1.auro.io:5000/v2.0" }, + "identity_api_version": "2", "region_name": "van1" } } diff --git a/os_client_config/vendors/conoha.json b/os_client_config/vendors/conoha.json index 8e33ca4..5636f09 100644 --- a/os_client_config/vendors/conoha.json +++ b/os_client_config/vendors/conoha.json @@ -2,12 +2,13 @@ "name": "conoha", "profile": { "auth": { - "auth_url": "https://identity.{region_name}.conoha.io/v2.0" + "auth_url": "https://identity.{region_name}.conoha.io" }, "regions": [ "sin1", "sjc1", "tyo1" - ] + ], + "identity_api_version": "2" } } diff --git a/os_client_config/vendors/datacentred.json b/os_client_config/vendors/datacentred.json index 1fb4dbb..2be4a58 100644 --- a/os_client_config/vendors/datacentred.json +++ b/os_client_config/vendors/datacentred.json @@ -2,9 +2,10 @@ "name": "datacentred", "profile": { "auth": { - "auth_url": "https://compute.datacentred.io:5000/v2.0" + "auth_url": "https://compute.datacentred.io:5000" }, "region-name": "sal01", + "identity_api_version": "2", "image_api_version": "1" } } diff --git a/os_client_config/vendors/dreamhost.json b/os_client_config/vendors/dreamhost.json index 8580826..6fc2ccf 100644 --- a/os_client_config/vendors/dreamhost.json +++ b/os_client_config/vendors/dreamhost.json @@ -2,8 +2,9 @@ "name": "dreamhost", "profile": { "auth": { - "auth_url": "https://keystone.dream.io/v2.0" + "auth_url": "https://keystone.dream.io" }, + "identity_api_version": "3", "region_name": "RegionOne", "image_format": "raw" } diff --git a/os_client_config/vendors/elastx.json b/os_client_config/vendors/elastx.json index cac755e..1e72482 100644 --- a/os_client_config/vendors/elastx.json +++ b/os_client_config/vendors/elastx.json @@ -2,8 +2,9 @@ "name": "elastx", "profile": { "auth": { - "auth_url": "https://ops.elastx.net:5000/v2.0" + "auth_url": "https://ops.elastx.net:5000" }, + "identity_api_version": "3", "region_name": "regionOne" } } diff --git a/os_client_config/vendors/entercloudsuite.json b/os_client_config/vendors/entercloudsuite.json index 5a425b4..6d2fc12 100644 --- a/os_client_config/vendors/entercloudsuite.json +++ b/os_client_config/vendors/entercloudsuite.json @@ -2,8 +2,9 @@ "name": "entercloudsuite", "profile": { "auth": { - "auth_url": "https://api.entercloudsuite.com/v2.0" + "auth_url": "https://api.entercloudsuite.com/" }, + "identity_api_version": "3", "volume_api_version": "1", "regions": [ "it-mil1", diff --git a/os_client_config/vendors/hp.json b/os_client_config/vendors/hp.json index ac280f2..b06b90a 100644 --- a/os_client_config/vendors/hp.json +++ b/os_client_config/vendors/hp.json @@ -2,12 +2,13 @@ "name": "hp", "profile": { "auth": { - "auth_url": "https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0" + "auth_url": "https://region-b.geo-1.identity.hpcloudsvc.com:35357" }, "regions": [ "region-a.geo-1", "region-b.geo-1" ], + "identity_api_version": "3", "dns_service_type": "hpext:dns", "volume_api_version": "1", "image_api_version": "1" diff --git a/os_client_config/vendors/ibmcloud.json b/os_client_config/vendors/ibmcloud.json new file mode 100644 index 0000000..90962c6 --- /dev/null +++ b/os_client_config/vendors/ibmcloud.json @@ -0,0 +1,13 @@ +{ + "name": "ibmcloud", + "profile": { + "auth": { + "auth_url": "https://identity.open.softlayer.com" + }, + "volume_api_version": "2", + "identity_api_version": "3", + "regions": [ + "london" + ] + } +} diff --git a/os_client_config/vendors/internap.json b/os_client_config/vendors/internap.json index 9b27536..d5ad49f 100644 --- a/os_client_config/vendors/internap.json +++ b/os_client_config/vendors/internap.json @@ -2,13 +2,14 @@ "name": "internap", "profile": { "auth": { - "auth_url": "https://identity.api.cloud.iweb.com/v2.0" + "auth_url": "https://identity.api.cloud.iweb.com" }, "regions": [ "ams01", "da01", "nyj01" ], + "identity_api_version": "3", "image_api_version": "1", "floating_ip_source": "None" } diff --git a/os_client_config/vendors/ovh.json b/os_client_config/vendors/ovh.json index 032741f..664f161 100644 --- a/os_client_config/vendors/ovh.json +++ b/os_client_config/vendors/ovh.json @@ -2,13 +2,14 @@ "name": "ovh", "profile": { "auth": { - "auth_url": "https://auth.cloud.ovh.net/v2.0" + "auth_url": "https://auth.cloud.ovh.net/" }, "regions": [ "BHS1", "GRA1", "SBG1" ], + "identity_api_version": "3", "image_format": "raw", "floating_ip_source": "None" } diff --git a/os_client_config/vendors/runabove.json b/os_client_config/vendors/runabove.json index 56dd945..abf1116 100644 --- a/os_client_config/vendors/runabove.json +++ b/os_client_config/vendors/runabove.json @@ -2,12 +2,13 @@ "name": "runabove", "profile": { "auth": { - "auth_url": "https://auth.runabove.io/v2.0" + "auth_url": "https://auth.runabove.io/" }, "regions": [ "BHS-1", "SBG-1" ], + "identity_api_version": "3", "image_format": "qcow2", "floating_ip_source": "None" } diff --git a/os_client_config/vendors/ultimum.json b/os_client_config/vendors/ultimum.json index 0b38d71..4bfd088 100644 --- a/os_client_config/vendors/ultimum.json +++ b/os_client_config/vendors/ultimum.json @@ -2,8 +2,9 @@ "name": "ultimum", "profile": { "auth": { - "auth_url": "https://console.ultimum-cloud.com:5000/v2.0" + "auth_url": "https://console.ultimum-cloud.com:5000/" }, + "identity_api_version": "3", "volume_api_version": "1", "region-name": "RegionOne" } |