Fixes #6579 allow for vault passwords ending with newline chars

Also add a unit test for vaulteditor to verify 1.0 passwords with newline chars.
This commit is contained in:
James Tanner 2014-03-19 14:36:52 -04:00
commit 409044155d
5 changed files with 30 additions and 8 deletions

View file

@ -133,9 +133,6 @@ class Cli(object):
except (OSError, IOError), e:
raise errors.AnsibleError("Could not read %s: %s" % (this_path, e))
# get rid of newline chars
tmp_vault_pass = tmp_vault_pass.strip()
if not options.ask_vault_pass:
vault_pass = tmp_vault_pass

View file

@ -127,9 +127,6 @@ def main(args):
except (OSError, IOError), e:
raise errors.AnsibleError("Could not read %s: %s" % (this_path, e))
# get rid of newline chars
tmp_vault_pass = tmp_vault_pass.strip()
if not options.ask_vault_pass:
vault_pass = tmp_vault_pass

View file

@ -105,8 +105,6 @@ def _read_password(filename):
f = open(filename, "rb")
data = f.read()
f.close
# get rid of newline chars
data = data.strip()
return data
def execute_create(args, options, parser):