mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #28079 from The-Loeki/fix-trace-on-windows-tasks
Fix for trace dump on failing imports for win32com & pythoncom 4 win_task
This commit is contained in:
commit
428e64e24d
@ -18,8 +18,12 @@ import logging
|
||||
import time
|
||||
|
||||
# Import 3rd Party Libraries
|
||||
import pythoncom
|
||||
import win32com.client
|
||||
try:
|
||||
import pythoncom
|
||||
import win32com.client
|
||||
HAS_DEPENDENCIES = True
|
||||
except ImportError:
|
||||
HAS_DEPENDENCIES = False
|
||||
from salt.ext.six.moves import range
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -146,6 +150,8 @@ def __virtual__():
|
||||
Only works on Windows systems
|
||||
'''
|
||||
if salt.utils.is_windows():
|
||||
if not HAS_DEPENDENCIES:
|
||||
log.warn('Could not load dependencies for {0}'.format(__virtualname__))
|
||||
return __virtualname__
|
||||
return False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user