1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-10 18:15:39 +00:00

consolidate if branches

This commit is contained in:
Alexei Znamensky 2026-05-31 11:59:00 +12:00
parent 3b37d55146
commit 61303d9326

View file

@ -508,10 +508,9 @@ def main():
result["status"]["error"] = err
# restarted and reloaded always perform commands unconditionally, so they always change state
if action in ("restarted", "reloaded"):
result["changed"] = True
elif (
result["status"]["current_state"] != result["status"]["previous_state"]
if (
action in ("restarted", "reloaded")
or result["status"]["current_state"] != result["status"]["previous_state"]
or result["status"]["current_pid"] != result["status"]["previous_pid"]
):
result["changed"] = True