dzdo prompt fix

fixed tests
dzdo has 2 paths now, with and w/o password
fixes #17838
This commit is contained in:
Brian Coca
2016-09-30 16:07:48 -04:00
committed by Brian Coca
parent 6008fbd5cf
commit dfff608ceb
2 changed files with 11 additions and 2 deletions

View File

@@ -562,8 +562,11 @@ class PlayContext(Base):
elif self.become_method == 'dzdo':
exe = self.become_exe or 'dzdo'
becomecmd = '%s -u %s %s' % (exe, self.become_user, command)
if self.become_pass:
prompt = '[dzdo via ansible, key=%s] password: ' % randbits
becomecmd = '%s -p %s -u %s %s' % (exe, pipes.quote(prompt), self.become_user, command)
else:
becomecmd = '%s -u %s %s' % (exe, self.become_user, command)
else:
raise AnsibleError("Privilege escalation method not found: %s" % self.become_method)