mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 05:40:23 -07:00
Correctly call get_config (#20452)
* Correctly call get_config * remove debug * Check for empty flags and LocalAnsibleModule * Peter's feedback
This commit is contained in:
parent
92a568c816
commit
7330ab8062
3 changed files with 12 additions and 8 deletions
|
@ -150,7 +150,7 @@ def get_current_config(module):
|
|||
flags = ['all']
|
||||
else:
|
||||
flags = []
|
||||
return get_config(flags=flags)
|
||||
return get_config(module=module, flags=flags)
|
||||
|
||||
def main():
|
||||
""" main entry point for module execution
|
||||
|
@ -182,7 +182,7 @@ def main():
|
|||
result = {'changed': False}
|
||||
|
||||
if module.params['backup']:
|
||||
result['__backup__'] = get_config()
|
||||
result['__backup__'] = get_config(module=module)
|
||||
|
||||
if not module.params['force']:
|
||||
contents = get_current_config(module)
|
||||
|
@ -195,7 +195,7 @@ def main():
|
|||
|
||||
if commands:
|
||||
if not module.check_mode:
|
||||
load_config(commands)
|
||||
load_config(module, commands)
|
||||
result['changed'] = True
|
||||
|
||||
result['updates'] = commands
|
||||
|
|
|
@ -366,8 +366,8 @@ def main():
|
|||
if match != 'none':
|
||||
config, have_banners = get_running_config(module)
|
||||
path = module.params['parents']
|
||||
configobjs = candidate.difference(config, path=path,match=match,
|
||||
replace=replace)
|
||||
configobjs = candidate.difference(config, path=path, match=match,
|
||||
replace=replace)
|
||||
else:
|
||||
configobjs = candidate.items
|
||||
have_banners = {}
|
||||
|
@ -398,7 +398,7 @@ def main():
|
|||
result['changed'] = True
|
||||
|
||||
if module.params['backup']:
|
||||
result['__backup__'] = get_config()
|
||||
result['__backup__'] = get_config(module=module)
|
||||
|
||||
if module.params['save']:
|
||||
if not module.check_mode:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue