mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Update deprecated salt.utils paths to new salt.utils.x paths
This commit is contained in:
parent
2617cf851f
commit
3b9d02977d
@ -13,7 +13,7 @@ from tests.support.case import SPMCase
|
||||
from tests.support.helpers import destructiveTest
|
||||
|
||||
# Import Salt Libraries
|
||||
import salt.utils
|
||||
import salt.utils.files
|
||||
|
||||
|
||||
@destructiveTest
|
||||
@ -32,14 +32,14 @@ class SPMBuildTest(SPMCase):
|
||||
for formula_dir in dirs:
|
||||
os.makedirs(formula_dir)
|
||||
|
||||
with salt.utils.fopen(self.formula_sls, 'w') as fp:
|
||||
with salt.utils.files.fopen(self.formula_sls, 'w') as fp:
|
||||
fp.write(textwrap.dedent('''\
|
||||
install-apache:
|
||||
pkg.installed:
|
||||
- name: apache2
|
||||
'''))
|
||||
|
||||
with salt.utils.fopen(self.formula_file, 'w') as fp:
|
||||
with salt.utils.files.fopen(self.formula_file, 'w') as fp:
|
||||
fp.write(textwrap.dedent('''\
|
||||
name: apache
|
||||
os: RedHat, Debian, Ubuntu, Suse, FreeBSD
|
||||
|
@ -14,7 +14,7 @@ from tests.support.mock import patch, call, NO_MOCK, NO_MOCK_REASON, MagicMock
|
||||
import salt.master
|
||||
from tests.support.case import ModuleCase
|
||||
from salt import auth
|
||||
import salt.utils
|
||||
import salt.utils.platform
|
||||
|
||||
|
||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
||||
@ -151,7 +151,7 @@ class MasterACLTestCase(ModuleCase):
|
||||
}
|
||||
self.addCleanup(delattr, self, 'valid_clear_load')
|
||||
|
||||
@skipIf(salt.utils.is_windows(), 'PAM eauth not available on Windows')
|
||||
@skipIf(salt.utils.platform.is_windows(), 'PAM eauth not available on Windows')
|
||||
def test_master_publish_name(self):
|
||||
'''
|
||||
Test to ensure a simple name can auth against a given function.
|
||||
@ -222,7 +222,7 @@ class MasterACLTestCase(ModuleCase):
|
||||
self.clear.publish(self.valid_clear_load)
|
||||
self.assertEqual(self.fire_event_mock.mock_calls, [])
|
||||
|
||||
@skipIf(salt.utils.is_windows(), 'PAM eauth not available on Windows')
|
||||
@skipIf(salt.utils.platform.is_windows(), 'PAM eauth not available on Windows')
|
||||
def test_master_minion_glob(self):
|
||||
'''
|
||||
Test to ensure we can allow access to a given
|
||||
@ -260,7 +260,7 @@ class MasterACLTestCase(ModuleCase):
|
||||
# Unimplemented
|
||||
pass
|
||||
|
||||
@skipIf(salt.utils.is_windows(), 'PAM eauth not available on Windows')
|
||||
@skipIf(salt.utils.platform.is_windows(), 'PAM eauth not available on Windows')
|
||||
def test_args_empty_spec(self):
|
||||
'''
|
||||
Test simple arg restriction allowed.
|
||||
@ -279,7 +279,7 @@ class MasterACLTestCase(ModuleCase):
|
||||
self.clear.publish(self.valid_clear_load)
|
||||
self.assertEqual(self.fire_event_mock.call_args[0][0]['fun'], 'test.empty')
|
||||
|
||||
@skipIf(salt.utils.is_windows(), 'PAM eauth not available on Windows')
|
||||
@skipIf(salt.utils.platform.is_windows(), 'PAM eauth not available on Windows')
|
||||
def test_args_simple_match(self):
|
||||
'''
|
||||
Test simple arg restriction allowed.
|
||||
@ -301,7 +301,7 @@ class MasterACLTestCase(ModuleCase):
|
||||
self.clear.publish(self.valid_clear_load)
|
||||
self.assertEqual(self.fire_event_mock.call_args[0][0]['fun'], 'test.echo')
|
||||
|
||||
@skipIf(salt.utils.is_windows(), 'PAM eauth not available on Windows')
|
||||
@skipIf(salt.utils.platform.is_windows(), 'PAM eauth not available on Windows')
|
||||
def test_args_more_args(self):
|
||||
'''
|
||||
Test simple arg restriction allowed to pass unlisted args.
|
||||
@ -362,7 +362,7 @@ class MasterACLTestCase(ModuleCase):
|
||||
self.clear.publish(self.valid_clear_load)
|
||||
self.assertEqual(self.fire_event_mock.mock_calls, [])
|
||||
|
||||
@skipIf(salt.utils.is_windows(), 'PAM eauth not available on Windows')
|
||||
@skipIf(salt.utils.platform.is_windows(), 'PAM eauth not available on Windows')
|
||||
def test_args_kwargs_match(self):
|
||||
'''
|
||||
Test simple kwargs restriction allowed.
|
||||
@ -436,7 +436,7 @@ class MasterACLTestCase(ModuleCase):
|
||||
self.clear.publish(self.valid_clear_load)
|
||||
self.assertEqual(self.fire_event_mock.mock_calls, [])
|
||||
|
||||
@skipIf(salt.utils.is_windows(), 'PAM eauth not available on Windows')
|
||||
@skipIf(salt.utils.platform.is_windows(), 'PAM eauth not available on Windows')
|
||||
def test_args_mixed_match(self):
|
||||
'''
|
||||
Test mixed args and kwargs restriction allowed.
|
||||
@ -582,7 +582,7 @@ class AuthACLTestCase(ModuleCase):
|
||||
}
|
||||
self.addCleanup(delattr, self, 'valid_clear_load')
|
||||
|
||||
@skipIf(salt.utils.is_windows(), 'PAM eauth not available on Windows')
|
||||
@skipIf(salt.utils.platform.is_windows(), 'PAM eauth not available on Windows')
|
||||
def test_acl_simple_allow(self):
|
||||
self.clear.publish(self.valid_clear_load)
|
||||
self.assertEqual(self.auth_check_mock.call_args[0][0],
|
||||
|
Loading…
Reference in New Issue
Block a user