nixos/tests: improve get_unit_info expressiveness on failure
This commit is contained in:
parent
b937c4c734
commit
5854aaf680
1 changed files with 5 additions and 1 deletions
|
@ -319,7 +319,11 @@ class Machine:
|
|||
def get_unit_info(self, unit, user=None):
|
||||
status, lines = self.systemctl('--no-pager show "{}"'.format(unit), user)
|
||||
if status != 0:
|
||||
return None
|
||||
raise Exception(
|
||||
'retrieving systemctl info for unit "{}" {} failed with exit code {}'.format(
|
||||
unit, "" if user is None else 'under user "{}"'.format(user), status
|
||||
)
|
||||
)
|
||||
|
||||
line_pattern = re.compile(r"^([^=]+)=(.*)$")
|
||||
|
||||
|
|
Loading…
Reference in a new issue