removes argument from vyos_config module

The state argument should not be in vyos_config.  This commit removes the
state argument
This commit is contained in:
Peter Sprygada 2016-09-04 09:13:14 -04:00
parent 1d48b47cad
commit 989a2c7d0f

View file

@ -100,15 +100,6 @@ options:
required: false required: false
default: false default: false
choices: ['yes', 'no'] 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 = """ 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): def check_args(module, warnings):
if module.params['save'] and module.params['update'] == 'check': if module.params['save'] and module.params['update'] == 'check':
warnings.append('The configuration will not be saved when update ' warnings.append('The configuration will not be saved when update '
@ -262,7 +248,7 @@ def load_config(module, commands, result):
result['changed'] = True result['changed'] = True
def present(module, result): def run(module, result):
# get the current active config from the node or passed in via # get the current active config from the node or passed in via
# the config param # the config param
config = get_config(module, result) config = get_config(module, result)
@ -283,12 +269,6 @@ def present(module, result):
'removed, please see the removed key') '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(): def main():
argument_spec = dict( argument_spec = dict(
@ -304,8 +284,6 @@ def main():
config=dict(), config=dict(),
save=dict(default=False, type='bool'), save=dict(default=False, type='bool'),
state=dict(choices=['present', 'absent'], default='present')
) )
mutually_exclusive = [('lines', 'src')] mutually_exclusive = [('lines', 'src')]
@ -315,8 +293,6 @@ def main():
mutually_exclusive=mutually_exclusive, mutually_exclusive=mutually_exclusive,
supports_check_mode=True) supports_check_mode=True)
state = module.params['state']
warnings = list() warnings = list()
check_args(module, warnings) check_args(module, warnings)
@ -326,7 +302,7 @@ def main():
result['__backup__'] = module.config.get_config() result['__backup__'] = module.config.get_config()
try: try:
invoke(state, module, result) run(module, result)
except NetworkError: except NetworkError:
exc = get_exception() exc = get_exception()
module.fail_json(msg=str(exc), **exc.kwargs) module.fail_json(msg=str(exc), **exc.kwargs)