Remove AIC references

Change-Id: I2d6c0dfe00aaee9fabbf248588c78524bb10285f
This commit is contained in:
Nicholas Jones 2018-05-16 09:59:16 -05:00
parent f4d5192e35
commit b9faf60307
5 changed files with 28 additions and 12 deletions

View File

@ -177,7 +177,6 @@ class RegionsController(rest.RestController):
""" function to check if any resource (flavor, customer, or image) is
assigned to the region_id
"""
_check_conf_initialization()
try:
resources = {
'flavors': [conf.api.fms_server.base,

View File

@ -50,7 +50,7 @@ rms = {
}
ordupdate = {
'discovery_url': 'http://127.0.0.1',
'discovery_url': 'http://' + config.orm_host,
'discovery_port': config.rms['port'],
'template_type': 'hot',
# This flag should be false only in case the ord does not support https.
@ -78,6 +78,17 @@ yaml_configs = {
'subnet': 'subnets',
'floatingip': 'floating_ips'
}
},
'cms_template_version': {
'resource_v1': {
'ranger_agent_version': 3.0,
'quota_unsupported_params': ['vips', 'members', 'pools', 'nat_instances', 'route_tables',
'health_monitors']
},
'resource_v2': {
'ranger_agent_version': 3.6,
'quota_unsupported_params': []
}
}
},
'flavor_yaml': {
@ -123,6 +134,12 @@ region_resource_id_status = {
'customer',
'image',
'flavor'
},
'allowed_ranger_agent_resource_version':
{
'customer': '3.0',
'image': '3.6',
'flavor': '3.0'
}
}

View File

@ -172,8 +172,8 @@ def yamlbuilder(alldata, region):
class CMSAdjustResource(object):
def __init__(self, aicVerion):
if aicVerion >= conf.yaml_configs.customer_yaml.cms_template_version.resource_v2.aic_version:
def __init__(self, rangerAgentVersion):
if rangerAgentVersion >= conf.yaml_configs.customer_yaml.cms_template_version.resource_v2.ranger_agent_version:
self.adjust_quota_parameters = CMSAdjustResourceV2().adjust_quota_parameters
else:
self.adjust_quota_parameters = CMSAdjustResourceV1().adjust_quota_parameters

View File

@ -63,24 +63,24 @@ def _validate_version(region, supported_resource_version):
def add_rms_status_to_regions(resource_regions, resource_type):
rms_regions = {}
all_regions = _get_all_rms_regions()
supported_versions = conf.region_resource_id_status.allowed_aic_resource_version
supported_versions = conf.region_resource_id_status.allowed_ranger_agent_resource_version
supported_resource_version = [value for key, value in supported_versions if key == resource_type]
# iterate through rms regions and gett regions status and version
for region in all_regions['regions']:
rms_regions[region['name']] = {'status': region['status'],
'version': region['aicVersion']}
'version': region['rangerAgentVersion']}
# iterate through resource regions and add to them rms status
for region in resource_regions:
if region['name'] in rms_regions:
# check if version valid
region['aicVersion'] = _validate_version(rms_regions[region['name']],
supported_resource_version)
if not region['aicVersion']:
region['rangerAgentVersion'] = _validate_version(rms_regions[region['name']],
supported_resource_version)
if not region['rangerAgentVersion']:
raise ErrorMessage(
message="aic version for region {} must be >={} ".format(
message="ranger agent version for region {} must be >={} ".format(
region['name'], supported_resource_version[0] if supported_resource_version else '0'))
region['rms_status'] = rms_regions[region['name']]['status']

View File

@ -231,7 +231,7 @@ class RmsTests(TestCase):
"name": "SNA 1",
"enabled": 1,
"state": "functional",
"aic_version": "aic3.0",
"ranger_agent_version": "aic3.0",
"endpoints": [
{
"type": "horizon",
@ -254,7 +254,7 @@ class RmsTests(TestCase):
cli.logic()
sys.stdout.seek(0)
output = sys.stdout.read()
self.assertIn('"aic_version": "aic3.0"', output)
self.assertIn('"ranger_agent_version": "aic3.0"', output)
# def test_error_with_wrong_port(self):
# args = self.parser.parse_args('--port 1111'.split())