mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -07:00
Added new module - frr_facts (#51804)
* Add new module frr_facts Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Fix return value Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Fix review comments Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Fix review comments Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Handle empty row for mpls ldp neighbors Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Fix review comments Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Fix CI Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Remove timestamp from cliconf pluging * Updated examples Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Fix sanity tests Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
This commit is contained in:
parent
2b9341f139
commit
bc403dbcda
12 changed files with 765 additions and 8 deletions
|
@ -187,12 +187,11 @@ class Cliconf(CliconfBase):
|
|||
|
||||
return self.send_command(command=command, prompt=prompt, answer=answer, sendonly=sendonly, check_all=check_all)
|
||||
|
||||
def run_commands(self, commands=None, check_rc=True, return_timestamps=False):
|
||||
def run_commands(self, commands=None, check_rc=True):
|
||||
if commands is None:
|
||||
raise ValueError("'commands' value is required")
|
||||
|
||||
responses = list()
|
||||
timestamps = list()
|
||||
for cmd in to_list(commands):
|
||||
if not isinstance(cmd, Mapping):
|
||||
cmd = {'command': cmd}
|
||||
|
@ -203,16 +202,11 @@ class Cliconf(CliconfBase):
|
|||
|
||||
try:
|
||||
out = self.send_command(**cmd)
|
||||
timestamp = get_timestamp()
|
||||
except AnsibleConnectionFailure as e:
|
||||
if check_rc:
|
||||
raise
|
||||
out = getattr(e, 'err', to_text(e))
|
||||
|
||||
responses.append(out)
|
||||
timestamps.append(timestamp)
|
||||
|
||||
if return_timestamps:
|
||||
return responses, timestamps
|
||||
else:
|
||||
return responses
|
||||
return responses
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue