openSUSE / salt

openSUSE and SUSE patches and backports for SaltStack
Apache License 2.0
22 stars 52 forks source link

Avoid crash on wrong output of systemctl version (bsc#1229539) #674

Closed vzhestkov closed 1 month ago

vzhestkov commented 1 month ago

What does this PR do?

Backport of https://github.com/saltstack/salt/pull/66856

In some cases calling systemctl --version with salt.grains.core._systemd could return unexpected output what could cause IndexError exception preventing minion service from running.

What issues does this PR fix or reference?

Tracks https://github.com/SUSE/spacewalk/issues/25122

Previous Behavior

IndexError exception on starting minions service caused by unexpected response of systemctl --version

New Behavior

Normal minion start with just error message in the log about unexpected output.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes/No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.