summaryrefslogtreecommitdiff
path: root/examples/osc-lib.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/osc-lib.py')
-rwxr-xr-xexamples/osc-lib.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/examples/osc-lib.py b/examples/osc-lib.py
index 2960a2f7..84501903 100755
--- a/examples/osc-lib.py
+++ b/examples/osc-lib.py
@@ -29,6 +29,8 @@ import common
from openstackclient.common import clientmanager
+from os_client_config import config as cloud_config
+
LOG = logging.getLogger('')
@@ -36,6 +38,16 @@ LOG = logging.getLogger('')
def run(opts):
"""Run the examples"""
+ # Do configuration file handling
+ cc = cloud_config.OpenStackConfig()
+ LOG.debug("defaults: %s", cc.defaults)
+
+ cloud = cc.get_one_cloud(
+ cloud=opts.cloud,
+ argparse=opts,
+ )
+ LOG.debug("cloud cfg: %s", cloud.config)
+
# Loop through extensions to get API versions
# Currently API versions are statically selected. Once discovery
# is working this can go away...
@@ -59,7 +71,7 @@ def run(opts):
# Collect the auth and config options together and give them to
# ClientManager and it will wrangle all of the goons into place.
client_manager = clientmanager.ClientManager(
- cli_options=opts,
+ cli_options=cloud,
verify=verify,
api_version=api_version,
)