Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixops
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c9fdc936ba70
Choose a base ref
...
head repository: NixOS/nixops
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8de09879d7b1
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Oct 9, 2020

  1. Copy the full SHA
    cf17054 View commit details

Commits on Nov 11, 2020

  1. Merge pull request #1413 from hercules-ci/fixup-check

    Fix nixops check: Strip known formatting from systemctl
    grahamc authored Nov 11, 2020
    Copy the full SHA
    8de0987 View commit details
Showing with 8 additions and 2 deletions.
  1. +8 −2 nixops/backends/__init__.py
10 changes: 8 additions & 2 deletions nixops/backends/__init__.py
Original file line number Diff line number Diff line change
@@ -197,12 +197,18 @@ def _check(self, res): # TODO -> None but supertype ResourceState -> True
res.load = avg

# Get the systemd units that are in a failed state or in progress.
# cat to inhibit color output.
out = self.run_command(
"systemctl --all --full --no-legend", capture_stdout=True
"systemctl --all --full --no-legend | cat", capture_stdout=True
).split("\n")
res.failed_units = []
res.in_progress_units = []
for line in out:
for raw_line in out:
# All this string processing is fragile.
# NixOS 20.09 and later support systemctl --output json
# Alternatively, we *could* talk to DBus which has always been
# the first-class API.
line = raw_line.strip(" ●")
match = re.match("^([^ ]+) .* failed .*$", line)
if match:
res.failed_units.append(match.group(1))