Update eos, ios, vyos cliconf plugin (#42300)

* Update eos cliconf plugin methods

*  Refactor eos cliconf plugin
*  Changes in eos module_utils as per cliconf plugin refactor

* Fix unit test and sanity failures

* Fix review comment
This commit is contained in:
Ganesh Nalawade 2018-07-04 19:45:21 +05:30 committed by GitHub
parent 2aa81bf05d
commit c068b88b38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 444 additions and 299 deletions

View file

@ -131,25 +131,8 @@ def to_commands(module, commands):
def run_commands(module, commands, check_rc=True):
responses = list()
connection = get_connection(module)
try:
outputs = connection.run_commands(commands)
except ConnectionError as exc:
if check_rc:
module.fail_json(msg=to_text(exc))
else:
outputs = exc
for item in to_list(outputs):
try:
item = to_text(item, errors='surrogate_or_strict')
except UnicodeError:
module.fail_json(msg=u'Failed to decode output from %s: %s' % (item, to_text(item)))
responses.append(item)
return responses
return connection.run_commands(commands=commands, check_rc=check_rc)
def load_config(module, commands):