mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-07-08 11:39:02 +00:00
More shell updates
This commit is contained in:
parent
e7f74251c8
commit
4e8b97ddeb
4 changed files with 19 additions and 15 deletions
|
|
@ -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():
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue