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

fix AttributeError eos_static_route (#32779)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
Trishna Guha 2017-11-10 04:48:05 +00:00 committed by GitHub
parent aef98fedeb
commit 9eb5921c1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -189,16 +189,17 @@ def main():
supports_check_mode=True)
address = module.params['address']
prefix = address.split('/')[-1]
if address is not None:
prefix = address.split('/')[-1]
if address and prefix:
if '/' not in address or not validate_ip_address(address.split('/')[0]):
module.fail_json(msg='{} is not a valid IP address'.format(address))
if not validate_prefix(prefix):
module.fail_json(msg='Length of prefix should be between 0 and 32 bits')
warnings = list()
check_args(module, warnings)
if '/' not in address or not validate_ip_address(address.split('/')[0]):
module.fail_json(msg='{} is not a valid IP address'.format(address))
if not validate_prefix(prefix):
module.fail_json(msg='Length of prefix should be between 0 and 32 bits')
result = {'changed': False}
if warnings:
result['warnings'] = warnings