Merge pull request #3240 from SirScott/vars_prompt_defaults

Display default value in prompt when using vars_prompt
This commit is contained in:
Michael DeHaan 2013-06-17 20:31:50 -07:00
commit cadecc0a52

View file

@ -581,7 +581,9 @@ class PlaybookCallbacks(object):
def on_vars_prompt(self, varname, private=True, prompt=None, encrypt=None, confirm=False, salt_size=None, salt=None, default=None): def on_vars_prompt(self, varname, private=True, prompt=None, encrypt=None, confirm=False, salt_size=None, salt=None, default=None):
if prompt: if prompt and default:
msg = "%s [%s]: " % (prompt, default)
elif prompt:
msg = "%s: " % prompt msg = "%s: " % prompt
else: else:
msg = 'input for %s: ' % varname msg = 'input for %s: ' % varname