mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Do not blindly ignore import failures
This commit is contained in:
parent
c1d5670b79
commit
b45039c240
1 changed files with 7 additions and 2 deletions
|
@ -13,10 +13,12 @@ of a configuration profile.
|
|||
from __future__ import absolute_import
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
try:
|
||||
import pwd
|
||||
HAS_PWD = True
|
||||
except ImportError:
|
||||
pass
|
||||
HAS_PWD = False
|
||||
|
||||
# Import salt libs
|
||||
import salt.utils
|
||||
|
@ -34,7 +36,10 @@ def __virtual__():
|
|||
if not salt.utils.is_darwin():
|
||||
return False, 'Not Darwin'
|
||||
|
||||
return __virtualname__
|
||||
if HAS_PWD:
|
||||
return __virtualname__
|
||||
else:
|
||||
return (False, 'The pwd module failed to load.')
|
||||
|
||||
|
||||
def _get_account_policy(name):
|
||||
|
|
Loading…
Add table
Reference in a new issue