Update old utils paths to use new utils paths

This commit is contained in:
rallytime 2018-10-02 15:12:58 -04:00
parent a65c60d862
commit b53c3e695a
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19
2 changed files with 2 additions and 2 deletions

View file

@ -97,7 +97,7 @@ def sha1_digest(instr):
Generate an sha1 hash of a given string.
'''
if six.PY3:
b = salt.utils.to_bytes(instr)
b = salt.utils.stringutils.to_bytes(instr)
return hashlib.sha1(b).hexdigest()
return hashlib.sha1(instr).hexdigest()

View file

@ -76,7 +76,7 @@ class StateModuleTest(ModuleCase, SaltReturnAssertsMixin):
'''
Normalize the line endings of a file.
'''
with salt.utils.fopen(path, 'rb') as fhr:
with salt.utils.files.fopen(path, 'rb') as fhr:
lines = fhr.read().splitlines()
with salt.utils.atomicfile.atomic_open(path, 'wb') as fhw:
for line in lines: