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:
Nilashish Chakraborty 2019-02-18 19:35:40 +05:30 committed by GitHub
parent 2b9341f139
commit bc403dbcda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 765 additions and 8 deletions

View file

@ -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