Update junos cliconf plugin (#43643)

* Update junos cliconf plugin

Fixes #39056

Refactor junos cliconf plugin api and other
minor changes

* Fix CI issue

* Fix CI failure
This commit is contained in:
Ganesh Nalawade 2018-08-06 10:08:05 +05:30 committed by GitHub
commit 35adc12c38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 146 additions and 28 deletions

View file

@ -23,8 +23,6 @@ import collections
import json
import re
from itertools import chain
from ansible.errors import AnsibleConnectionFailure
from ansible.module_utils._text import to_bytes, to_text
from ansible.module_utils.connection import ConnectionError
@ -138,7 +136,7 @@ class Cliconf(CliconfBase):
lookup = {'running': 'running-config', 'startup': 'startup-config'}
if source not in lookup:
return self.invalid_params("fetching configuration from %s is not supported" % source)
raise ValueError("fetching configuration from %s is not supported" % source)
cmd = 'show {0} '.format(lookup[source])
if format and format is not 'text':