1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Additional fix for #27167: port-channel interface idempotence (#27979)

This commit is contained in:
rahushen 2017-08-14 11:44:12 -04:00 committed by Nathaniel Case
parent d3e48a51f5
commit b74300b657

View file

@ -207,7 +207,10 @@ def get_value(arg, config, module):
def get_existing(module, args):
existing = {}
netcfg = CustomNetworkConfig(indent=2, contents=get_config(module))
parents = ['interface {0}'.format(module.params['interface'].capitalize())]
if module.params['interface'].startswith('loopback') or module.params['interface'].startswith('port-channel'):
parents = ['interface {0}'.format(module.params['interface'])]
else:
parents = ['interface {0}'.format(module.params['interface'].capitalize())]
config = netcfg.get_section(parents)
if 'ospf' in config:
for arg in args:
@ -390,7 +393,7 @@ def main():
'message_digest_password']],
supports_check_mode=True)
if not module.params['interface'].startswith('loopback'):
if not module.params['interface'].startswith('loopback') and not module.params['interface'].startswith('port-channel'):
module.params['interface'] = module.params['interface'].capitalize()
warnings = list()