From 19c072031109638a5b1e4d0dbcb87f8218a74260 Mon Sep 17 00:00:00 2001 From: Vlad Monea Date: Wed, 31 Aug 2022 11:44:10 +0300 Subject: [PATCH] check if there is a features line --- hubblestack/grains/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hubblestack/grains/core.py b/hubblestack/grains/core.py index 11f38cf11..009d6da83 100644 --- a/hubblestack/grains/core.py +++ b/hubblestack/grains/core.py @@ -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"