From e0f7912e372e84aa7640f649baca4b611b72290d Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Sun, 4 Sep 2016 09:09:38 -0400 Subject: [PATCH] removes state argument from ios_config The state argument should not be in ios_config. This change removes the state argument --- network/ios/ios_config.py | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/network/ios/ios_config.py b/network/ios/ios_config.py index 5e71d79ff31..a48754dcf6a 100644 --- a/network/ios/ios_config.py +++ b/network/ios/ios_config.py @@ -174,15 +174,6 @@ options: default: no choices: ['yes', 'no'] version_added: "2.2" - state: - description: - - This argument specifies whether or not the running-config is - present on the remote device. When set to I(absent) the - running-config on the remote device is erased. - required: false - default: no - choices: ['yes', 'no'] - version_added: "2.2" """ EXAMPLES = """ @@ -247,11 +238,6 @@ from ansible.module_utils.ios import NetworkModule, NetworkError from ansible.module_utils.netcfg import NetworkConfig, dumps from ansible.module_utils.netcli import Command -def invoke(name, *args, **kwargs): - func = globals().get(name) - if func: - return func(*args, **kwargs) - def check_args(module, warnings): if module.params['parents']: if not module.params['lines'] or module.params['src']: @@ -304,7 +290,7 @@ def load_config(module, commands, result): result['changed'] = module.params['update'] != 'check' result['updates'] = commands.split('\n') -def present(module, result): +def run(module, result): match = module.params['match'] replace = module.params['replace'] @@ -341,11 +327,6 @@ def present(module, result): if module.params['save'] and not module.check_mode: module.config.save_config() -def absent(module, result): - if not module.check_mode: - module.cli('write erase') - result['changed'] = True - def main(): argument_spec = dict( @@ -371,8 +352,6 @@ def main(): default=dict(type='bool', default=False), save=dict(type='bool', default=False), - - state=dict(choices=['present', 'absent'], default='present') ) mutually_exclusive = [('lines', 'src')] @@ -382,8 +361,6 @@ def main(): mutually_exclusive=mutually_exclusive, supports_check_mode=True) - state = module.params['state'] - if module.params['force'] is True: module.params['match'] = 'none' @@ -396,7 +373,7 @@ def main(): result['__backup__'] = module.config.get_config() try: - invoke(state, module, result) + run(module, result) except NetworkError: load_backup(module) exc = get_exception()