Skip schema check in network validation

Some changes in tripleo-heat-templates introduced in Rocky are failing
the schema validation that is part of the network environment validation.

Until the new schema validation has been added to os-net-config's
schema.yaml we skip the schema check to prevent the validation from
failing on a valid set of configs.

Change-Id: I1910bde037e4d456254345573f9f873b7f3a0927
(cherry picked from commit 8f8396b6ca)
This commit is contained in:
Florian Fuchs 2018-11-21 10:25:05 +01:00
parent d396dfd509
commit 2f7cf79e66
2 changed files with 17 additions and 6 deletions

View File

@ -74,6 +74,8 @@ class TestNicConfigs(base.TestCase):
self.assertEqual(len(errors), 1)
self.assertIn("'foo' must be a list", errors[0])
# See comment from 2018-11-22 in library/network_environment.py
"""
def test_bridge_has_type(self):
nic_data = self.nic_data([{
'name': 'storage',
@ -143,6 +145,7 @@ class TestNicConfigs(base.TestCase):
self.assertEqual(len(errors), 1)
self.assertIn("members/items/oneOf: {} is not valid under any"
" of the given schemas", errors[0])
"""
def test_more_than_one_bond(self):
nic_data = self.nic_data([{
@ -196,6 +199,8 @@ class TestNicConfigs(base.TestCase):
errors = validation.check_nic_configs("controller.yaml", nic_data)
self.assertEqual([], errors)
# See comment from 2018-11-22 in library/network_environment.py
"""
def test_one_bond_no_interfaces(self):
nic_data = self.nic_data([{
'type': 'ovs_bridge',
@ -207,6 +212,7 @@ class TestNicConfigs(base.TestCase):
errors = validation.check_nic_configs("controller.yaml", nic_data)
self.assertEqual(len(errors), 1)
self.assertIn('members/minItems: [] is too short', errors[0])
"""
def test_one_bond_multiple_interfaces(self):
nic_data = self.nic_data([{

View File

@ -24,7 +24,7 @@ import yaml
import six
from ansible.module_utils.basic import AnsibleModule
from os_net_config import validator
# from os_net_config import validator
from tripleo_validations.utils import get_nested
@ -165,11 +165,16 @@ def check_nic_configs(path, nic_data):
if not bridges:
continue
# Validate the os_net_config object against the schema
v_errors = validator.validate_config(bridges, path)
errors.extend(v_errors)
if len(v_errors) > 0:
continue
# TODO(flfuchs) 2018-11-22: Rocky introduced a couple of
# template changes using a schema that cant't be found in
# os-net-config's schema.yaml file yet, so the validator fails
# even though the templates are working. Until this is done, we
# skip the schema validation.
# Validate the os_net_config object against the schema.
# v_errors = validator.validate_config(bridges, path)
# errors.extend(v_errors)
# if len(v_errors) > 0:
# continue
# If we get here, the nic config file conforms to the schema and
# there is no more need to check for existence and type of