From 6786773797f3a27377f97ce408262379e655f734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Ka=C5=82u=C5=BCa?= Date: Tue, 10 Sep 2013 15:00:29 +0200 Subject: [PATCH] filter out qoutes since they cause random errors --- lib/ansible/runner/lookup_plugins/password.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/runner/lookup_plugins/password.py b/lib/ansible/runner/lookup_plugins/password.py index 3d988e03c6..6da0fdbe37 100644 --- a/lib/ansible/runner/lookup_plugins/password.py +++ b/lib/ansible/runner/lookup_plugins/password.py @@ -66,7 +66,7 @@ class LookupModule(object): elif name == 'chars': use_chars=[] if ",," in value: use_chars.append(',') - use_chars.extend(value.replace(',,',',').replace('"','').replace("'",'').split(',')) + use_chars.extend(value.replace(',,',',').split(',')) paramvals['chars'] = use_chars else: paramvals[name] = value @@ -83,7 +83,7 @@ class LookupModule(object): pathdir = os.path.dirname(path) if not os.path.isdir(pathdir): os.makedirs(pathdir) - chars = "".join([getattr(string,c,c) for c in use_chars]) + chars = "".join([getattr(string,c,c) for c in use_chars]).replace('"','').replace("'",'') password = ''.join(random.choice(chars) for _ in range(length)) if encrypt is not None: salt = self.random_salt()