import yaml
-from apex.common import utils
from apex.common import constants
REQ_DEPLOY_SETTINGS = ['sdn_controller',
'vpp',
'ceph',
'gluon',
- 'rt_kvm']
+ 'rt_kvm',
+ 'os_version',
+ 'l2gw',
+ 'sriov',
+ 'containers',
+ 'ceph_device',
+ 'vim']
OPT_DEPLOY_SETTINGS = ['performance',
'vsperf',
- 'ceph_device',
'yardstick',
'dovetail',
'odl_vpp_routing_node',
+ 'dvr',
'odl_vpp_netvirt',
- 'barometer']
+ 'barometer',
+ 'calipso']
VALID_ROLES = ['Controller', 'Compute', 'ObjectStorage']
VALID_PERF_OPTS = ['kernel', 'nova', 'vpp', 'ovs']
VALID_DATAPLANES = ['ovs', 'ovs_dpdk', 'fdio']
-VALID_ODL_VERSIONS = ['carbon', 'nitrogen', 'master']
+REQ_PATCH_CRITERIA = ['change-id', 'project']
+OPT_PATCH_CRITERIA = ['branch']
class DeploySettings(dict):
self['deploy_options'][req_set] = 'ovs'
elif req_set == 'ceph':
self['deploy_options'][req_set] = True
+ elif req_set == 'ceph_device':
+ self['deploy_options'][req_set] = '/dev/loop3'
elif req_set == 'odl_version':
self['deploy_options'][req_set] = \
constants.DEFAULT_ODL_VERSION
+ elif req_set == 'os_version':
+ self['deploy_options'][req_set] = \
+ constants.DEFAULT_OS_VERSION
+ elif req_set == 'vim':
+ self['deploy_options'][req_set] = 'openstack'
else:
self['deploy_options'][req_set] = False
elif req_set == 'odl_version' and self['deploy_options'][
- 'odl_version'] not in VALID_ODL_VERSIONS:
+ 'odl_version'] not in constants.VALID_ODL_VERSIONS:
raise DeploySettingsException(
"Invalid ODL version: {}".format(self[deploy_options][
'odl_version']))
+ elif req_set == 'sriov':
+ if self['deploy_options'][req_set] is True:
+ raise DeploySettingsException(
+ "Invalid SRIOV interface name: {}".format(
+ self['deploy_options']['sriov']))
if 'performance' in deploy_options:
if not isinstance(deploy_options['performance'], dict):
" ".join(
VALID_PERF_OPTS)
))
+ # validate global params
+ if 'ha_enabled' not in self['global_params']:
+
+ raise DeploySettingsException('ha_enabled is missing in global '
+ 'parameters of deploy settings file')
+ if 'patches' not in self['global_params']:
+ self['global_params']['patches'] = dict()
+ for node in ('undercloud', 'overcloud'):
+ if node not in self['global_params']['patches']:
+ self['global_params']['patches'][node] = list()
+ else:
+ patches = self['global_params']['patches'][node]
+ assert isinstance(patches, list)
+ for patch in patches:
+ assert isinstance(patch, dict)
+ # Assert all required criteria exists for each patch
+ assert all(i in patch.keys() for i in REQ_PATCH_CRITERIA)
+ patch_criteria = REQ_PATCH_CRITERIA + OPT_PATCH_CRITERIA
+ # Assert all patch keys are valid criteria
+ assert all(i in patch_criteria for i in patch.keys())
def _dump_performance(self):
"""
Creates performance settings string for bash consumption.
-
Output will be in the form of a list that can be iterated over in
bash, with each string being the direct input to the performance
setting script in the form <role> <category> <key> <value> to