mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
decorator link fix, updating context names, as well as updating macutils tests for latest changes
This commit is contained in:
parent
1e4497d7a6
commit
f1b40c4411
2 changed files with 7 additions and 4 deletions
|
@ -15,7 +15,6 @@ import time
|
|||
# Import Salt Libs
|
||||
import salt.modules.cmdmod
|
||||
import salt.utils.args
|
||||
import salt.utils.decorators as decorators
|
||||
import salt.utils.files
|
||||
import salt.utils.path
|
||||
import salt.utils.platform
|
||||
|
@ -306,7 +305,7 @@ def _available_services(refresh=False):
|
|||
try:
|
||||
if __context__['available_services'] and not refresh:
|
||||
log.debug('Found context for available services.')
|
||||
__context__['available_services_cached'] = True
|
||||
__context__['using_cached_services'] = True
|
||||
return __context__['available_services']
|
||||
except KeyError:
|
||||
pass
|
||||
|
@ -367,7 +366,7 @@ def _available_services(refresh=False):
|
|||
# a fix for this issue. https://github.com/saltstack/salt/issues/48414
|
||||
__context__['available_services'] = _available_services
|
||||
# this is a fresh gathering of services, set cached to false
|
||||
__context__['available_services_cached'] = False
|
||||
__context__['using_cached_services'] = False
|
||||
|
||||
return __context__['available_services']
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import os
|
|||
# Import Salt Testing Libs
|
||||
from tests.support.unit import TestCase, skipIf
|
||||
from tests.support.mock import MagicMock, patch, NO_MOCK, NO_MOCK_REASON, call
|
||||
from tests.support.mixins import LoaderModuleMockMixin
|
||||
|
||||
# Import Salt libs
|
||||
import salt.utils.mac_utils as mac_utils
|
||||
|
@ -21,10 +22,13 @@ from salt.ext import six
|
|||
|
||||
|
||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
||||
class MacUtilsTestCase(TestCase):
|
||||
class MacUtilsTestCase(TestCase, LoaderModuleMockMixin):
|
||||
'''
|
||||
test mac_utils salt utility
|
||||
'''
|
||||
def setup_loader_modules(self):
|
||||
return {mac_utils: {}}
|
||||
|
||||
def test_execute_return_success_not_supported(self):
|
||||
'''
|
||||
test execute_return_success function
|
||||
|
|
Loading…
Add table
Reference in a new issue