More shell updates

This commit is contained in:
Michael DeHaan
2014-03-12 17:22:59 -04:00
parent e7f74251c8
commit 4e8b97ddeb
4 changed files with 19 additions and 15 deletions

View File

@@ -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():