mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Add a test on jnpr.junos.utils.sw presence (#3666)
This commit is contained in:
committed by
Matt Clay
parent
2042d948db
commit
abfc8d36a8
@@ -93,7 +93,11 @@ EXAMPLES = """
|
||||
reboot: no
|
||||
"""
|
||||
|
||||
from jnpr.junos.utils.sw import SW
|
||||
try:
|
||||
from jnpr.junos.utils.sw import SW
|
||||
HAS_SW = True
|
||||
except ImportError:
|
||||
HAS_SW = False
|
||||
|
||||
def install_package(module):
|
||||
junos = SW(module.connection.device)
|
||||
@@ -126,6 +130,9 @@ def main():
|
||||
module = get_module(argument_spec=spec,
|
||||
supports_check_mode=True)
|
||||
|
||||
if not HAS_SW:
|
||||
module.fail_json(msg='Missing jnpr.junos.utils.sw module')
|
||||
|
||||
result = dict(changed=False)
|
||||
|
||||
do_upgrade = module.params['force'] or False
|
||||
|
||||
Reference in New Issue
Block a user