summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-08-03 14:42:41 +0000
committerGerrit Code Review <review@openstack.org>2016-08-03 14:42:41 +0000
commit9f0a7a31f4fd067c452c18f9546e69b0a8d684e4 (patch)
treef33372a19bf46d7cdb213fcb10907cc33aacfbd9
parent1f7ecbc3ff482de3ae8323fa5a62a359510e13d9 (diff)
parent481be16b8b385e1fcccd34607da8a8a3f5bde69f (diff)
downloados-client-config-9f0a7a31f4fd067c452c18f9546e69b0a8d684e4.tar.gz
Merge "Add support for deprecating cloud profiles"
-rw-r--r--os_client_config/config.py6
-rw-r--r--os_client_config/defaults.json2
-rw-r--r--os_client_config/vendor-schema.json11
3 files changed, 19 insertions, 0 deletions
diff --git a/os_client_config/config.py b/os_client_config/config.py
index f1df797..84476b2 100644
--- a/os_client_config/config.py
+++ b/os_client_config/config.py
@@ -468,6 +468,12 @@ class OpenStackConfig(object):
else:
profile_data = vendors.get_profile(profile_name)
if profile_data:
+ status = profile_data.pop('status', 'active')
+ message = profile_data.pop('message', '')
+ if status == 'deprecated':
+ warnings.warn(
+ "{profile_name} is deprecated: {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/defaults.json b/os_client_config/defaults.json
index f501862..ba8bf39 100644
--- a/os_client_config/defaults.json
+++ b/os_client_config/defaults.json
@@ -13,10 +13,12 @@
"image_api_version": "2",
"image_format": "qcow2",
"key_manager_api_version": "v1",
+ "message": "",
"metering_api_version": "2",
"network_api_version": "2",
"object_store_api_version": "1",
"orchestration_api_version": "1",
"secgroup_source": "neutron",
+ "status": "active",
"volume_api_version": "2"
}
diff --git a/os_client_config/vendor-schema.json b/os_client_config/vendor-schema.json
index 6c57ba4..a5bee27 100644
--- a/os_client_config/vendor-schema.json
+++ b/os_client_config/vendor-schema.json
@@ -55,12 +55,23 @@
"default": "public",
"enum": [ "public", "internal", "admin" ]
},
+ "message": {
+ "name": "Status message",
+ "description": "Optional message with information related to status",
+ "type": "string"
+ },
"secgroup_source": {
"name": "Security Group Source",
"description": "Which service provides security groups",
"enum": [ "neutron", "nova", "None" ],
"default": "neutron"
},
+ "status": {
+ "name": "Vendor status",
+ "description": "Status of the vendor's cloud",
+ "enum": [ "active", "deprecated"],
+ "default": "active"
+ },
"compute_service_name": {
"name": "Compute API Service Name",
"description": "Compute API Service Name",