Fix nxos_vtp_password and nxos_vrf_interface for remove idempotency tests (#27724)

* fixes for 27600 27676

* add sanity tests
This commit is contained in:
saichint 2017-08-08 09:40:22 -07:00 committed by Nathaniel Case
commit babec35faa
10 changed files with 145 additions and 136 deletions

View file

@ -222,7 +222,9 @@ def main():
changed = False
end_state = existing
if vrf != existing['vrf'] and state == 'absent':
if not existing['vrf']:
pass
elif vrf != existing['vrf'] and state == 'absent':
module.fail_json(msg='The VRF you are trying to remove '
'from the interface does not exist '
'on that interface.',

View file

@ -215,7 +215,10 @@ def main():
commands = []
if state == 'absent':
if vtp_password is not None:
# if vtp_password is not set, some devices returns '\\'
if not existing['vtp_password'] or existing['vtp_password'] == '\\':
pass
elif vtp_password is not None:
if existing['vtp_password'] == proposed['vtp_password']:
commands.append(['no vtp password'])
else: