decorator link fix, updating context names, as well as updating macutils tests for latest changes

This commit is contained in:
Wesley Whetstone 2018-08-14 14:24:33 -07:00
parent 1e4497d7a6
commit f1b40c4411
No known key found for this signature in database
GPG key ID: 327AC40B0253A798
2 changed files with 7 additions and 4 deletions

View file

@ -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']

View file

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