diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-07-18 02:14:48 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-07-18 02:14:48 +0000 |
commit | eeec8797591fe7268d24c9e6ff1c38750173f746 (patch) | |
tree | df5c092c8b027f1f150f50937284d7fa385845e6 /tools | |
parent | 52205fd2ee5b35eecf9644b3c511b0990c283372 (diff) | |
parent | e65a8cbc220b30481a76756bc6157be2e4bc1c74 (diff) |
Merge "Add ComputeHCI role and related validations"
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/yaml-validate.py | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/tools/yaml-validate.py b/tools/yaml-validate.py index 66e38ef2..3828766f 100755 --- a/tools/yaml-validate.py +++ b/tools/yaml-validate.py @@ -98,14 +98,30 @@ def validate_hci_compute_services_default(env_filename, env_tpl): env_services_list = env_tpl['parameter_defaults']['ComputeServices'] env_services_list.remove('OS::TripleO::Services::CephOSD') roles_filename = os.path.join(os.path.dirname(env_filename), - '../roles_data.yaml') + '../roles/Compute.yaml') roles_tpl = yaml.load(open(roles_filename).read()) for role in roles_tpl: if role['name'] == 'Compute': roles_services_list = role['ServicesDefault'] if sorted(env_services_list) != sorted(roles_services_list): - print('ERROR: ComputeServices in %s is different ' - 'from ServicesDefault in roles_data.yaml' % env_filename) + print('ERROR: ComputeServices in %s is different from ' + 'ServicesDefault in roles/Compute.yaml' % env_filename) + return 1 + return 0 + + +def validate_hci_computehci_role(hci_role_filename, hci_role_tpl): + compute_role_filename = os.path.join(os.path.dirname(hci_role_filename), + './Compute.yaml') + compute_role_tpl = yaml.load(open(compute_role_filename).read()) + compute_role_services = compute_role_tpl[0]['ServicesDefault'] + for role in hci_role_tpl: + if role['name'] == 'ComputeHCI': + hci_role_services = role['ServicesDefault'] + hci_role_services.remove('OS::TripleO::Services::CephOSD') + if sorted(hci_role_services) != sorted(compute_role_services): + print('ERROR: ServicesDefault in %s is different from' + 'ServicesDefault in roles/Compute.yaml' % hci_role_filename) return 1 return 0 @@ -305,6 +321,9 @@ def validate(filename, param_map): if filename.endswith('hyperconverged-ceph.yaml'): retval = validate_hci_compute_services_default(filename, tpl) + if filename.startswith('./roles/ComputeHCI.yaml'): + retval = validate_hci_computehci_role(filename, tpl) + except Exception: print(traceback.format_exc()) return 1 |