Chattr version py3 fix

This commit is contained in:
Daniel A. Wozniak 2019-04-22 00:11:13 +00:00
parent cf88c27353
commit 169c2d56aa
No known key found for this signature in database
GPG key ID: 166B9D2C06C82D61
2 changed files with 6 additions and 3 deletions

View file

@ -172,7 +172,10 @@ def _parse_chattr_man(man):
'''
Parse the contents of a chattr man page to find the E2fsprogs version
'''
match = re.search(r'E2fsprogs version [0-9\.]+', man)
match = re.search(
r'E2fsprogs version [0-9\.]+',
salt.utils.string_utils.to_str(man),
)
if match:
version = match.group().strip('E2fsprogs version ')
else:

View file

@ -2048,7 +2048,7 @@ class FileBasicsTestCase(TestCase, LoaderModuleMockMixin):
class ChattrVersionTests(TestCase):
CHATTR_MAN = (
CHATTR_MAN = salt.utils.stringutils.to_bytes((
'AVAILABILITY\n'
'chattr is part of the e2fsprogs package and is available '
'from http://e2fsprogs.sourceforge.net.\n'
@ -2059,7 +2059,7 @@ class ChattrVersionTests(TestCase):
'January 2017 '
' '
' CHATTR(1)'
)
))
def test__parse_chattr_version(self):
'''