Skip to content

Commit

Permalink
test: Adjust logind version parsing to systemd 241
Browse files Browse the repository at this point in the history
`loginctl --version` now looks like `systemd 241 (241)` which the
previous parsing stumbled upon. Just take the first number from the
first line now.
  • Loading branch information
martinpitt committed Feb 23, 2019
1 parent da08769 commit 5d64037
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_logind.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import unittest
import os
import sys
import re
import subprocess

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

def setUp(self):
self.p_mock = None
Expand Down

0 comments on commit 5d64037

Please sign in to comment.