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",