mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Update old utils paths to use new utils paths
This commit is contained in:
parent
202da7a94f
commit
5de2245c11
2 changed files with 7 additions and 4 deletions
|
@ -2246,7 +2246,9 @@ class FileTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
if salt.utils.platform.is_windows():
|
||||
import subprocess
|
||||
import win32api
|
||||
p = subprocess.Popen(salt.utils.to_str('type {}'.format(win32api.GetShortPathName(test_file))),
|
||||
p = subprocess.Popen(
|
||||
salt.utils.stringutils.to_str(
|
||||
'type {}'.format(win32api.GetShortPathName(test_file))),
|
||||
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
p.poll()
|
||||
out = p.stdout.read()
|
||||
|
|
|
@ -59,6 +59,7 @@ from tests.support.paths import FILES, TMP
|
|||
# Import Salt libs
|
||||
import salt.utils.files
|
||||
import salt.utils.platform
|
||||
import salt.utils.stringutils
|
||||
|
||||
if salt.utils.platform.is_windows():
|
||||
import salt.utils.win_functions
|
||||
|
@ -1611,11 +1612,11 @@ def dedent(text, linesep=os.linesep):
|
|||
'''
|
||||
A wrapper around textwrap.dedent that also sets line endings.
|
||||
'''
|
||||
linesep = salt.utils.to_unicode(linesep)
|
||||
unicode_text = textwrap.dedent(salt.utils.to_unicode(text))
|
||||
linesep = salt.utils.stringutils.to_unicode(linesep)
|
||||
unicode_text = textwrap.dedent(salt.utils.stringutils.to_unicode(text))
|
||||
clean_text = linesep.join(unicode_text.splitlines())
|
||||
if unicode_text.endswith(u'\n'):
|
||||
clean_text += linesep
|
||||
if not isinstance(text, six.text_type):
|
||||
return salt.utils.to_bytes(clean_text)
|
||||
return salt.utils.stringutils.to_bytes(clean_text)
|
||||
return clean_text
|
||||
|
|
Loading…
Add table
Reference in a new issue