* Fix Issue #39598

Signed-off-by: Anas Badaha <anasb@mellanox.com>

* Fix unit test for onyx_config

Signed-off-by: Anas Badaha <anasb@mellanox.com>

* Add comments for save running config

Signed-off-by: Anas Badaha <anasb@mellanox.com>

* Enhance onyx_config bug fix

Signed-off-by: Anas Badaha <anasb@mellanox.com>

* Fix result['changed'] = True comment

Signed-off-by: Anas Badaha <anasb@mellanox.com>
This commit is contained in:
anasbadaha
2018-12-21 08:24:10 +02:00
committed by Ganesh Nalawade
parent 6178a55afd
commit d2446cbf0f
2 changed files with 11 additions and 13 deletions

View File

@@ -159,6 +159,7 @@ def run(module, result):
else:
configobjs = candidate.items
total_commands = []
if configobjs:
commands = dumps(configobjs, 'commands').split('\n')
@@ -169,18 +170,15 @@ def run(module, result):
if module.params['after']:
commands.extend(module.params['after'])
result['updates'] = commands
# send the configuration commands to the device and merge
# them with the current running config
if not module.check_mode:
load_config(module, commands)
result['changed'] = True
total_commands.extend(commands)
result['updates'] = total_commands
if module.params['save']:
if not module.check_mode:
run_commands(module, 'configuration write')
total_commands.append('configuration write')
if total_commands:
result['changed'] = True
if not module.check_mode:
load_config(module, total_commands)
def main():