mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
#47117: fix the napalm imports in the netacl execution module
This commit is contained in:
parent
8e21703f13
commit
48396467c1
1 changed files with 2 additions and 9 deletions
|
@ -40,15 +40,8 @@ try:
|
|||
except ImportError:
|
||||
HAS_CAPIRCA = False
|
||||
|
||||
try:
|
||||
# pylint: disable=W0611
|
||||
import napalm_base
|
||||
# pylint: enable=W0611
|
||||
HAS_NAPALM = True
|
||||
except ImportError:
|
||||
HAS_NAPALM = False
|
||||
|
||||
# import Salt modules
|
||||
import salt.utils.napalm
|
||||
from salt.utils.napalm import proxy_napalm_wrap
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
@ -68,7 +61,7 @@ def __virtual__():
|
|||
'''
|
||||
This module requires both NAPALM and Capirca.
|
||||
'''
|
||||
if HAS_CAPIRCA and HAS_NAPALM:
|
||||
if HAS_CAPIRCA and salt.utils.napalm.virtual(__opts__, __virtualname__, __file__):
|
||||
return __virtualname__
|
||||
else:
|
||||
return (False, 'The netacl (napalm_acl) module cannot be loaded: \
|
||||
|
|
Loading…
Add table
Reference in a new issue