Add a test on jnpr.junos.utils.sw presence (#3666)

reviewable/pr18780/r1
Michael Scherer 9 years ago committed by Toshio Kuratomi
parent 925b4c68ca
commit 4c569fd535

@ -93,7 +93,11 @@ EXAMPLES = """
reboot: no reboot: no
""" """
try:
from jnpr.junos.utils.sw import SW from jnpr.junos.utils.sw import SW
HAS_SW = True
except ImportError:
HAS_SW = False
def install_package(module): def install_package(module):
junos = SW(module.connection.device) junos = SW(module.connection.device)
@ -126,6 +130,9 @@ def main():
module = get_module(argument_spec=spec, module = get_module(argument_spec=spec,
supports_check_mode=True) supports_check_mode=True)
if not HAS_SW:
module.fail_json(msg='Missing jnpr.junos.utils.sw module')
result = dict(changed=False) result = dict(changed=False)
do_upgrade = module.params['force'] or False do_upgrade = module.params['force'] or False

Loading…
Cancel
Save