Skip to content

Commit

Permalink
removed use_unsafe_shell and doc_fragments/systemd
Browse files Browse the repository at this point in the history
  • Loading branch information
NomakCooper committed Feb 19, 2025
1 parent 4bf73d0 commit bfb3ee6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 39 deletions.
36 changes: 0 additions & 36 deletions plugins/doc_fragments/systemd.py

This file was deleted.

6 changes: 3 additions & 3 deletions plugins/modules/systemd_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
description:
- List of unit names to process.
- It supports .service, .target, .socket, and .mount units type.
- Each name must correspond to the full name of the systemd unit.
type: list
elements: str
default: []
Expand All @@ -38,7 +39,6 @@
author:
- Marco Noce (@NomakCooper)
extends_documentation_fragment:
- community.general.systemd.documentation
- community.general.attributes
- community.general.attributes.info_module
'''
Expand Down Expand Up @@ -119,7 +119,7 @@


def run_command(module, cmd):
rc, stdout, stderr = module.run_command(cmd, use_unsafe_shell=True, check_rc=True)
rc, stdout, stderr = module.run_command(cmd, check_rc=True)
return stdout.strip()


Expand Down Expand Up @@ -169,7 +169,7 @@ def unit_exists(module, systemctl_bin, unit):
cmd = [systemctl_bin, "show", "-p", "LoadState", "--", unit]
else:
cmd = [systemctl_bin, "show", unit, "-p", "LoadState"]
rc, stdout, stderr = module.run_command(cmd, use_unsafe_shell=True)
rc, stdout, stderr = module.run_command(cmd)
return (rc == 0)


Expand Down

0 comments on commit bfb3ee6

Please sign in to comment.