From daaafb68abbc750b1a8408d54b79ec132732a5ab Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Mon, 11 Jul 2016 15:12:06 -0700 Subject: [PATCH] removes unneeded check_args function from ios_command The module would raise a KeyError trying to find the save_config key which is not present in the argument_spec. This was caused by the check_args() function. Since the ios shared argument spec isn't used the check_args function is not needed and has been removed. --- network/ios/ios_command.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/network/ios/ios_command.py b/network/ios/ios_command.py index 4b546410a9f..b61853157cc 100644 --- a/network/ios/ios_command.py +++ b/network/ios/ios_command.py @@ -132,13 +132,10 @@ warnings: type: list sample: ['...', '...'] """ +from ansible.module_utils.basic import get_exception from ansible.module_utils.netcmd import CommandRunner, FailedConditionsError from ansible.module_utils.ios import NetworkModule, NetworkError -def check_args(module, warnings): - if module.params['save_config'] is True: - warnings.append('save_config argument will be ignored') - def to_lines(stdout): for item in stdout: if isinstance(item, basestring): @@ -148,7 +145,7 @@ def to_lines(stdout): def main(): spec = dict( commands=dict(type='list', required=True), - wait_for=dict(type='list'), + wait_for=dict(type='list', aliases=['waitfor']), retries=dict(default=10, type='int'), interval=dict(default=1, type='int') ) @@ -161,7 +158,6 @@ def main(): conditionals = module.params['wait_for'] or list() warnings = list() - check_args(module, warnings) runner = CommandRunner(module)