Skip to content

Commit

Permalink
Fix exos_config:save_when when a stopped process is present (#110) (#345
Browse files Browse the repository at this point in the history
)

When a process is created, and then terminated but not deleted, the
save config prompt will change. This module expected the old prompt,
which never arrived, so the save will run into a timeout.

This is how the special prompt looks:
> * Slot-1 HOSTNAMEHERE.1 # save
> The configuration file primary.cfg already exists.
> Some process has been terminated/stopped. If you save the configuration
> then that process's configuration will be lost.
> Do you want to continue? (y/N)

(cherry picked from commit ac1351a)

Co-authored-by: uedvt359 <[email protected]>
  • Loading branch information
patchback[bot] and uedvt359 authored Dec 7, 2021
1 parent c7ae03e commit e8a5226
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/110-fix-exos-save-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- exos_config - fix a hang due to an unexpected prompt during save_when (https://github.com/ansible-collections/community.network/pull/110).
2 changes: 1 addition & 1 deletion plugins/modules/network/exos/exos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def save_config(module, result):
result['changed'] = True
if not module.check_mode:
command = {"command": "save configuration",
"prompt": "Do you want to save configuration", "answer": "y"}
"prompt": ["Do you want to save configuration", "Do you want to continue"], "answer": "y"}
run_commands(module, command)
else:
module.warn('Skipping command `save configuration` '
Expand Down

0 comments on commit e8a5226

Please sign in to comment.