Merge pull request #198 from pilou-/avoid_using_echo
Avoid to use the builtin 'echo' and remove unused variable
This commit is contained in:
commit
1fdd4bbc8f
1 changed files with 4 additions and 7 deletions
|
@ -86,8 +86,6 @@ debconf: name='oracle-java7-installer' question='shared/accepted-oracle-license-
|
||||||
debconf: name='tzdata'
|
debconf: name='tzdata'
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import pipes
|
|
||||||
|
|
||||||
def get_selections(module, pkg):
|
def get_selections(module, pkg):
|
||||||
cmd = [module.get_bin_path('debconf-show', True), pkg]
|
cmd = [module.get_bin_path('debconf-show', True), pkg]
|
||||||
rc, out, err = module.run_command(' '.join(cmd))
|
rc, out, err = module.run_command(' '.join(cmd))
|
||||||
|
@ -106,14 +104,14 @@ def get_selections(module, pkg):
|
||||||
|
|
||||||
def set_selection(module, pkg, question, vtype, value, unseen):
|
def set_selection(module, pkg, question, vtype, value, unseen):
|
||||||
|
|
||||||
data = ' '.join([ question, vtype, value ])
|
|
||||||
|
|
||||||
setsel = module.get_bin_path('debconf-set-selections', True)
|
setsel = module.get_bin_path('debconf-set-selections', True)
|
||||||
cmd = ["echo %s %s |" % (pipes.quote(pkg), pipes.quote(data)), setsel]
|
cmd = [setsel]
|
||||||
if unseen:
|
if unseen:
|
||||||
cmd.append('-u')
|
cmd.append('-u')
|
||||||
|
|
||||||
return module.run_command(' '.join(cmd), use_unsafe_shell=True)
|
data = ' '.join([pkg, question, vtype, value])
|
||||||
|
|
||||||
|
return module.run_command(cmd, data=data)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
|
@ -137,7 +135,6 @@ def main():
|
||||||
unseen = module.params["unseen"]
|
unseen = module.params["unseen"]
|
||||||
|
|
||||||
prev = get_selections(module, pkg)
|
prev = get_selections(module, pkg)
|
||||||
diff = ''
|
|
||||||
|
|
||||||
changed = False
|
changed = False
|
||||||
msg = ""
|
msg = ""
|
||||||
|
|
Loading…
Reference in a new issue