From 989a2c7d0f7b9594c50315a1fd11bce3b6f12317 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Sun, 4 Sep 2016 09:13:14 -0400 Subject: [PATCH] removes argument from vyos_config module The state argument should not be in vyos_config. This commit removes the state argument --- network/vyos/vyos_config.py | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/network/vyos/vyos_config.py b/network/vyos/vyos_config.py index 39d9be7e4e5..dbe1b257bc2 100644 --- a/network/vyos/vyos_config.py +++ b/network/vyos/vyos_config.py @@ -100,15 +100,6 @@ options: required: false default: false choices: ['yes', 'no'] - state: - description: - - The C(state) argument controls the existing state of the config - file on disk. When set to C(present), the configuration should - exist on disk and when set to C(absent) the configuration file - is removed. This only applies to the startup configuration. - required: false - default: present - choices: ['present', 'absent'] """ RETURN = """ @@ -162,11 +153,6 @@ CONFIG_FILTERS = [ ] -def invoke(name, *args, **kwargs): - func = globals().get(name) - if func: - return func(*args, **kwargs) - def check_args(module, warnings): if module.params['save'] and module.params['update'] == 'check': warnings.append('The configuration will not be saved when update ' @@ -262,7 +248,7 @@ def load_config(module, commands, result): result['changed'] = True -def present(module, result): +def run(module, result): # get the current active config from the node or passed in via # the config param config = get_config(module, result) @@ -283,12 +269,6 @@ def present(module, result): 'removed, please see the removed key') -def absent(module, result): - if not module.check_mode: - module.cli('rm /config/config.boot') - result['changed'] = True - - def main(): argument_spec = dict( @@ -304,8 +284,6 @@ def main(): config=dict(), save=dict(default=False, type='bool'), - - state=dict(choices=['present', 'absent'], default='present') ) mutually_exclusive = [('lines', 'src')] @@ -315,8 +293,6 @@ def main(): mutually_exclusive=mutually_exclusive, supports_check_mode=True) - state = module.params['state'] - warnings = list() check_args(module, warnings) @@ -326,7 +302,7 @@ def main(): result['__backup__'] = module.config.get_config() try: - invoke(state, module, result) + run(module, result) except NetworkError: exc = get_exception() module.fail_json(msg=str(exc), **exc.kwargs)