mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-08 14:20:04 -07:00
Various commits to enable no-shell or safe-shell usage, more to come.
This commit is contained in:
parent
60a7f57300
commit
6010e74839
6 changed files with 29 additions and 22 deletions
|
@ -51,6 +51,7 @@ EXAMPLES = '''
|
|||
- opkg: name=foo,bar state=absent
|
||||
'''
|
||||
|
||||
import pipes
|
||||
|
||||
def update_package_db(module, opkg_path):
|
||||
""" Updates packages list. """
|
||||
|
@ -66,7 +67,7 @@ def query_package(module, opkg_path, name, state="present"):
|
|||
|
||||
if state == "present":
|
||||
|
||||
rc, out, err = module.run_command("%s list-installed | grep -q ^%s" % (opkg_path, name))
|
||||
rc, out, err = module.run_command("%s list-installed | grep -q ^%s" % (pipes.quote(opkg_path), pipes.quote(name)), use_unsafe_shell=True)
|
||||
if rc == 0:
|
||||
return True
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue