Skip to content

Instantly share code, notes, and snippets.

@xarses
Last active May 16, 2017 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xarses/55e2517bd49903df2c5ec7ff5f697d74 to your computer and use it in GitHub Desktop.
Save xarses/55e2517bd49903df2c5ec7ff5f697d74 to your computer and use it in GitHub Desktop.
os_client_config
$ export | grep OS_
declare -x OS_CLOUD="a-vsv1-c1"
$ python -i
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os_client_config as oscc
>>> sdk = oscc.make_sdk()
>>>
$ python -i
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os_client_config as oscc
>>> oscc.get_config()
<os_client_config.cloud_config.CloudConfig object at 0x7f1c506f8c50>
>>> oscc.get_config()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/os_client_config/__init__.py", line 40, in get_config
return config.get_one_cloud(options=parsed_options, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/os_client_config/config.py", line 1071, in get_one_cloud
auth_plugin = loader.load_from_options(**config['auth'])
File "/home/awoodward/.local/lib/python2.7/site-packages/keystoneauth1/loading/base.py", line 162, in load_from_options
raise exceptions.MissingRequiredOptions(missing_required)
keystoneauth1.exceptions.auth_plugins.MissingRequiredOptions: Auth plugin requires parameters which were not given: auth_url
>>> oscc.get_config()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/os_client_config/__init__.py", line 40, in get_config
return config.get_one_cloud(options=parsed_options, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/os_client_config/config.py", line 1071, in get_one_cloud
auth_plugin = loader.load_from_options(**config['auth'])
File "/home/awoodward/.local/lib/python2.7/site-packages/keystoneauth1/loading/base.py", line 162, in load_from_options
raise exceptions.MissingRequiredOptions(missing_required)
keystoneauth1.exceptions.auth_plugins.MissingRequiredOptions: Auth plugin requires parameters which were not given: auth_url
>>>
$ python -i
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os_client_config as oscc
>>> oscc.make_sdk()
<openstack.connection.Connection object at 0x7fb9b3f0e690>
>>> oscc.make_client('network')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/os_client_config/__init__.py", line 80, in make_client
cloud = get_config(service_key=service_key, options=options, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/os_client_config/__init__.py", line 40, in get_config
return config.get_one_cloud(options=parsed_options, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/os_client_config/config.py", line 1071, in get_one_cloud
auth_plugin = loader.load_from_options(**config['auth'])
File "/home/awoodward/.local/lib/python2.7/site-packages/keystoneauth1/loading/base.py", line 162, in load_from_options
raise exceptions.MissingRequiredOptions(missing_required)
keystoneauth1.exceptions.auth_plugins.MissingRequiredOptions: Auth plugin requires parameters which were not given: auth_url
>>>
$ python -i
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os_client_config as oscc
>>> oscc.make_client('network')
<neutronclient.v2_0.client.Client object at 0x7ff4aee56290>
oscc.make_client('network')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/os_client_config/__init__.py", line 80, in make_client
cloud = get_config(service_key=service_key, options=options, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/os_client_config/__init__.py", line 40, in get_config
return config.get_one_cloud(options=parsed_options, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/os_client_config/config.py", line 1071, in get_one_cloud
auth_plugin = loader.load_from_options(**config['auth'])
File "/home/awoodward/.local/lib/python2.7/site-packages/keystoneauth1/loading/base.py", line 162, in load_from_options
raise exceptions.MissingRequiredOptions(missing_required)
keystoneauth1.exceptions.auth_plugins.MissingRequiredOptions: Auth plugin requires parameters which were not given: auth_url
>>> oscc.make_client('network', cloud='a-vsv1-c1')
<neutronclient.v2_0.client.Client object at 0x7ff4ae1f42d0>
>>> oscc.make_client('network', cloud='a-vsv1-c1')
<neutronclient.v2_0.client.Client object at 0x7ff4b0d51290>
$ python -i
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os_client_config as oscc
>>> cc = oscc.OpenStackConfig()
>>> cc.get_one_cloud()
<os_client_config.cloud_config.CloudConfig object at 0x7f94e06b5cd0>
>>> cc.get_one_cloud()
<os_client_config.cloud_config.CloudConfig object at 0x7f94e0610610>
>>> cc.get_one_cloud()
<os_client_config.cloud_config.CloudConfig object at 0x7f94e06afc10>
>>> cc.get_one_cloud()
<os_client_config.cloud_config.CloudConfig object at 0x7f94e0610390>
>>> c2 = oscc.OpenStackConfig()
>>> c2.get_one_cloud()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/os_client_config/config.py", line 1071, in get_one_cloud
auth_plugin = loader.load_from_options(**config['auth'])
File "/home/awoodward/.local/lib/python2.7/site-packages/keystoneauth1/loading/base.py", line 162, in load_from_options
raise exceptions.MissingRequiredOptions(missing_required)
keystoneauth1.exceptions.auth_plugins.MissingRequiredOptions: Auth plugin requires parameters which were not given: auth_url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment