diff options
author | Monty Taylor <mordred@inaugust.com> | 2016-07-14 10:30:49 +0800 |
---|---|---|
committer | Monty Taylor <mordred@inaugust.com> | 2016-07-16 07:23:27 +0800 |
commit | d9e9bb791ba169e828d6068534ee2f430f4668eb (patch) | |
tree | 4004dcb161221d63481d3c3efc0d68cac3827911 | |
parent | 481be16b8b385e1fcccd34607da8a8a3f5bde69f (diff) | |
download | os-client-config-d9e9bb791ba169e828d6068534ee2f430f4668eb.tar.gz |
Add support for listing a cloud as shut down
We've had one vendor cloud go away in the past, and there is one
existing deprecated cloud currently. Add support for providing the
user with an informative error message in the case where they
attempt to use such a cloud.
Change-Id: I894e0c0a4786e60fce1238bb2883828e89d44b01
-rw-r--r-- | os_client_config/config.py | 5 | ||||
-rw-r--r-- | os_client_config/vendor-schema.json | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/os_client_config/config.py b/os_client_config/config.py index 84476b2..f9b2de5 100644 --- a/os_client_config/config.py +++ b/os_client_config/config.py @@ -474,6 +474,11 @@ class OpenStackConfig(object): warnings.warn( "{profile_name} is deprecated: {message}".format( profile_name=profile_name, message=message)) + elif status == 'shutdown': + raise exceptions.OpenStackConfigException( + "{profile_name} references a cloud that no longer" + " exists: {message}".format( + profile_name=profile_name, message=message)) _auth_update(cloud, profile_data) else: # Can't find the requested vendor config, go about business diff --git a/os_client_config/vendor-schema.json b/os_client_config/vendor-schema.json index a5bee27..6a6f456 100644 --- a/os_client_config/vendor-schema.json +++ b/os_client_config/vendor-schema.json @@ -69,7 +69,7 @@ "status": { "name": "Vendor status", "description": "Status of the vendor's cloud", - "enum": [ "active", "deprecated"], + "enum": [ "active", "deprecated", "shutdown"], "default": "active" }, "compute_service_name": { |