Add support for deprecating cloud profiles

We've had HP shut down their public cloud, and DreamHost has recent spun
up a new cloud with a different operational profile and auth_url that is
essentially a replacement cloud. That means people using the old
information need to do things, so we need to be able to communicate that
to them.

Add support for adding a deprecated status to a vendor profile, as well
as a verbose message explaining what the user may do to remediate.

Change-Id: I19b67d7cd71fba2d9da0e3a6adb2d229ead65396
This commit is contained in:
Monty Taylor 2016-07-09 17:34:11 +09:00
parent 51b4cbee52
commit 481be16b8b
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
3 changed files with 19 additions and 0 deletions

View File

@ -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

View File

@ -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"
}

View File

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