Merge "Stop replacing dashes with underscores for Kolla interfaces"
This commit is contained in:
commit
c726492e49
@ -95,10 +95,6 @@ class ActionModule(ActionBase):
|
||||
# Get the network interface for this network.
|
||||
iface = ("{{ '%s' | net_interface }}" % net_name)
|
||||
iface = self._templar.template(iface)
|
||||
if iface:
|
||||
# Ansible fact names replace dashes with underscores.
|
||||
# FIXME(mgoddard): Is this still required?
|
||||
iface = iface.replace('-', '_')
|
||||
if required and not iface:
|
||||
msg = ("Required network '%s' (%s) does not have an interface "
|
||||
"configured for this host" % (net_name, description))
|
||||
|
@ -136,26 +136,6 @@ class TestCase(unittest.TestCase):
|
||||
}
|
||||
self.assertEqual(expected, result)
|
||||
|
||||
def test__run_one_with_dashes(self):
|
||||
variables = copy.deepcopy(self.variables)
|
||||
variables["foo_interface"] = "eth-0"
|
||||
module = self._create_module(variables)
|
||||
interfaces = [{
|
||||
"var_name": "kolla_foo_interface",
|
||||
"network": "foo",
|
||||
"description": "Foo network",
|
||||
"required": False,
|
||||
}]
|
||||
result = module._run(interfaces, [])
|
||||
expected = {
|
||||
"changed": False,
|
||||
"ansible_facts": {
|
||||
"kolla_foo_interface": "eth_0",
|
||||
},
|
||||
"_ansible_facts_cacheable": False,
|
||||
}
|
||||
self.assertEqual(expected, result)
|
||||
|
||||
def test__run_interface_not_mapped(self):
|
||||
module = self._create_module()
|
||||
interfaces = [{
|
||||
|
Loading…
Reference in New Issue
Block a user