diff options
author | Nathaniel Case <ncase@redhat.com> | 2016-09-16 11:28:45 -0400 |
---|---|---|
committer | Nathaniel Case <ncase@redhat.com> | 2016-09-16 11:30:19 -0400 |
commit | b753e8dc48ea390b33a9c366165d36a2a27ec692 (patch) | |
tree | 8ef8cc26898d0b5e864e3418cfa3aa82f41244db | |
parent | e0a77bb8d5fbaad8a8fc0db5f7c89cc7caf91ecc (diff) | |
download | ansible-b753e8dc48ea390b33a9c366165d36a2a27ec692.tar.gz |
Add simple checks for libraries to junos
-rw-r--r-- | lib/ansible/module_utils/junos.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/ansible/module_utils/junos.py b/lib/ansible/module_utils/junos.py index de52a663ae..2b1ba49faf 100644 --- a/lib/ansible/module_utils/junos.py +++ b/lib/ansible/module_utils/junos.py @@ -72,6 +72,16 @@ def xml_to_string(val): class Netconf(object): def __init__(self): + if not HAS_PYEZ: + raise NetworkError( + msg='junos-eznc >= 1.2.2 is required but does not appear to be installed. ' + 'It can be installed using `pip install junos-eznc`' + ) + if not HAS_JXMLEASE: + raise NetworkError( + msg='jxmlease is required but does not appear to be installed. ' + 'It can be installed using `pip install jxmlease`' + ) self.device = None self.config = None self._locked = False |