Rel240/fix nxos interface ospf (#28898)

* Fixes 28897 nxos_interface_ospf idempotence

* Handle all characters upper or lower with tests
This commit is contained in:
Mike Wiebe 2017-09-01 11:07:18 -04:00 committed by Nathaniel Case
commit fb1aa54341
2 changed files with 126 additions and 2 deletions

View file

@ -394,7 +394,15 @@ def main():
'message_digest_password']],
supports_check_mode=True)
if not module.params['interface'].startswith('loopback') and not module.params['interface'].startswith('port-channel'):
# Normalize interface input data.
#
# * For port-channel and loopback interfaces expection is all lower case names.
# * All other interfaces the expectation is an uppercase leading character
# followed by lower case characters.
#
if re.match(r'(port-channel|loopback)', module.params['interface'], re.I):
module.params['interface'] = module.params['interface'].lower()
else:
module.params['interface'] = module.params['interface'].capitalize()
warnings = list()