mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
More shell updates
This commit is contained in:
@@ -84,6 +84,8 @@ debconf: name='oracle-java7-installer' question='shared/accepted-oracle-license-
|
||||
debconf: name='tzdata'
|
||||
'''
|
||||
|
||||
import pipes
|
||||
|
||||
def get_selections(module, pkg):
|
||||
cmd = [module.get_bin_path('debconf-show', True), pkg]
|
||||
rc, out, err = module.run_command(' '.join(cmd))
|
||||
@@ -105,11 +107,11 @@ def set_selection(module, pkg, question, vtype, value, unseen):
|
||||
data = ' '.join([ question, vtype, value ])
|
||||
|
||||
setsel = module.get_bin_path('debconf-set-selections', True)
|
||||
cmd = ["echo '%s %s' |" % (pkg, data), setsel]
|
||||
cmd = ["echo '%s %s' |" % (pipes.quote(pkg), pipes.quote(data)), setsel]
|
||||
if unseen:
|
||||
cmd.append('-u')
|
||||
|
||||
return module.run_command(' '.join(cmd))
|
||||
return module.run_command(' '.join(cmd), use_unsafe_shell=True)
|
||||
|
||||
def main():
|
||||
|
||||
|
||||
Reference in New Issue
Block a user