Skip to content

Commit 5d64037

Browse files
committed
test: Adjust logind version parsing to systemd 241
`loginctl --version` now looks like `systemd 241 (241)` which the previous parsing stumbled upon. Just take the first number from the first line now.
1 parent da08769 commit 5d64037

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_logind.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import unittest
1515
import os
1616
import sys
17+
import re
1718
import subprocess
1819

1920
import dbusmock
@@ -37,7 +38,7 @@ def setUpClass(klass):
3738
if have_loginctl:
3839
out = subprocess.check_output(['loginctl', '--version'],
3940
universal_newlines=True)
40-
klass.version = out.splitlines()[0].split()[-1]
41+
klass.version = re.search(r'(\d+)', out.splitlines()[0]).group(1)
4142

4243
def setUp(self):
4344
self.p_mock = None

0 commit comments

Comments
 (0)