strip password command output and take only the first line

This commit is contained in:
Romain Bignon 2014-02-07 17:08:56 +01:00
commit d9e33e50b8

View file

@ -150,6 +150,8 @@ class ValueBackendPassword(Value):
password = subprocess.check_output(cmd, shell=True)
except subprocess.CalledProcessError as e:
raise ValueError(u'The call to the external tool failed: %s' % e)
else:
password = password.partition('\n')[0].strip('\r\n\t')
self.check_valid(password)
self._domain = domain
self._value = to_unicode(password)