Skip to content

Commit

Permalink
Merge pull request #1146 from vladmonea/fix-systemctl-splitlines
Browse files Browse the repository at this point in the history
Systemctl might not output the expected info
  • Loading branch information
vladmonea authored Sep 7, 2022
2 parents 4bf9658 + 19c0720 commit 6b07741
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hubblestack/grains/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,10 @@ def os_data():
grains["systemd"] = {}
systemd_info = __mods__["cmd.run"]("systemctl --version").splitlines()
grains["systemd"]["version"] = systemd_info[0].split()[1]
grains["systemd"]["features"] = systemd_info[1]
if len(systemd_info) > 1:
grains["systemd"]["features"] = systemd_info[1]
else:
grains["systemd"]["features"] = ""

# Add init grain
grains["init"] = "unknown"
Expand Down

0 comments on commit 6b07741

Please sign in to comment.