Fix secretsmanager random password wrong length (#3213)

* Enhance function get_parameter by parameter name, version or labels

* Fix random password with exclude characters return wrong length
This commit is contained in:
Ninh Khong 2020-08-03 19:42:42 +07:00 committed by GitHub
commit 061c609a8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -51,6 +51,8 @@ def random_password(
if include_space:
password += " "
required_characters += " "
if exclude_characters:
password = _exclude_characters(password, exclude_characters)
password = "".join(
six.text_type(random.choice(password)) for x in range(password_length)
@ -61,7 +63,6 @@ def random_password(
password, required_characters
)
password = _exclude_characters(password, exclude_characters)
return password