Merge pull request #47241 from cloudflare/fix-47117

Fix the imports into the netacl execution and state modules
This commit is contained in:
Nicole Thomas 2018-04-23 10:56:31 -04:00 committed by GitHub
commit b78295aee9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 18 deletions

View file

@ -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: \

View file

@ -41,14 +41,6 @@ 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.utils.napalm
# ------------------------------------------------------------------------------
@ -70,7 +62,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 state cannot be loaded: \