Skip to content

Commit

Permalink
Handle cases where normal commit operation throws a prompt (ansible#6…
Browse files Browse the repository at this point in the history
…2132)

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
  • Loading branch information
NilashishC authored and chkp-orso committed Sep 18, 2019
1 parent aa421ce commit 6018190
Showing 1 changed file with 5 additions and 0 deletions.
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 6018190

Please sign in to comment.