mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-30 04:49:09 -07:00
Fix cli_command multiple prompt issue (#44922)
* Add check in network_cli to handle all prompts * Add check_all flag to mandatory handle all the command prompt in prompts list. By default if any one prompt is handled remaining prompts are ignored. * Fix cli_command multiple prompt issue * If multiple prompt and answers are given as input network_cli handles only the first prompt that matched by default * If a command execution results in muliple prompt the fix add support to set a boolean option C(check_all) to indicate network_cli to wait till all the prompts and answers are processed. * Update cli_command * Update api doc * Fix unit test failure * Fix CI failure * Update network_cli * Fix review comment
This commit is contained in:
parent
cbd54a4b2c
commit
c0326aea2f
11 changed files with 65 additions and 33 deletions
|
@ -149,10 +149,10 @@ class Cliconf(CliconfBase):
|
|||
diff['config_diff'] = dumps(configdiffobjs, 'commands') if configdiffobjs else ''
|
||||
return diff
|
||||
|
||||
def get(self, command=None, prompt=None, answer=None, sendonly=False, newline=True, output=None):
|
||||
def get(self, command=None, prompt=None, answer=None, sendonly=False, newline=True, output=None, check_all=False):
|
||||
if output:
|
||||
raise ValueError("'output' value %s is not supported for get" % output)
|
||||
return self.send_command(command=command, prompt=prompt, answer=answer, sendonly=sendonly, newline=newline)
|
||||
return self.send_command(command=command, prompt=prompt, answer=answer, sendonly=sendonly, newline=newline, check_all=check_all)
|
||||
|
||||
def commit(self, comment=None, label=None, replace=None):
|
||||
cmd_obj = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue