Skip to content

Commit

Permalink
Merge pull request #73032 from marijanp/improvement-test-driver-py
Browse files Browse the repository at this point in the history
nixos/tests: improve get_unit_info expressiveness on failure
  • Loading branch information
Mic92 committed Nov 8, 2019
2 parents b937c4c + 5854aaf commit 438a0cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nixos/lib/test-driver/test-driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,11 @@ def wait_for_unit(self, unit, user=None):
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"^([^=]+)=(.*)$")

Expand Down

0 comments on commit 438a0cd

Please sign in to comment.