Skip to content

Commit

Permalink
Handle cases where normal commit operation throws a prompt (#62132)
Browse files Browse the repository at this point in the history
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
(cherry picked from commit f176645)

Add changelog for iosxr prompt fix

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
  • Loading branch information
NilashishC committed Sep 12, 2019
1 parent 7e3d322 commit 164ba7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/62131-iosxr_prompt_fix.yaml
@@ -0,0 +1,2 @@
bug_fixes:
- iosxr - support cases where a normal commit operation also throws a prompt (https://github.com/ansible/ansible/pull/62132)
5 changes: 5 additions & 0 deletions lib/ansible/plugins/cliconf/iosxr.py
Expand Up @@ -191,6 +191,11 @@ def commit(self, comment=None, label=None, replace=None):
cmd_obj['command'] = 'commit label {0}'.format(label)
else:
cmd_obj['command'] = 'commit show-error'
# In some cases even a normal commit, i.e., !replace,
# throws a prompt and we need to handle it before
# proceeding further
cmd_obj['prompt'] = '(C|c)onfirm'
cmd_obj['answer'] = 'y'

self.send_command(**cmd_obj)

Expand Down

0 comments on commit 164ba7e

Please sign in to comment.