diff --git a/library/network_connections.py b/library/network_connections.py index 54cf345..43129e6 100755 --- a/library/network_connections.py +++ b/library/network_connections.py @@ -2648,7 +2648,6 @@ class Cmd_initscripts(Cmd): def run_prepare(self): Cmd.run_prepare(self) - names = {} for idx, connection in enumerate(self.connections): if connection['type'] in [ 'macvlan' ]: self.log_fatal(idx, 'unsupported type %s for initscripts provider' % (connection['type'])) diff --git a/library/test_network_connections.py b/library/test_network_connections.py index a9bb60f..bde388d 100755 --- a/library/test_network_connections.py +++ b/library/test_network_connections.py @@ -112,15 +112,19 @@ class TestValidator(unittest.TestCase): ARGS_CONNECTIONS.validate_connection_one(mode, connections, idx) except n.ValidationError as e: continue - if 'type' in connection: - content_current = kwargs.get('initscripts_content_current', None) - if content_current: - content_current = content_current[idx] - c = n.IfcfgUtil.ifcfg_create(connections, idx, content_current = content_current) - #pprint("con[%s] = \"%s\"" % (idx, connections[idx]['name']), c) - exp = kwargs.get('initscripts_dict_expected', None) - if exp is not None: - self.assertEqual(exp[idx], c) + if 'type' not in connection: + continue + if connection['type'] in ['macvlan']: + # initscripts do not support this type. Skip the test. + continue + content_current = kwargs.get('initscripts_content_current', None) + if content_current: + content_current = content_current[idx] + c = n.IfcfgUtil.ifcfg_create(connections, idx, content_current = content_current) + #pprint("con[%s] = \"%s\"" % (idx, connections[idx]['name']), c) + exp = kwargs.get('initscripts_dict_expected', None) + if exp is not None: + self.assertEqual(exp[idx], c) def do_connections_validate(self, expected_connections, input_connections, **kwargs):