diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-01-17 15:59:21 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-01-17 15:59:21 -0500 |
commit | 1e746f00edbf478cf0ae43b66ff7899b6819fa33 (patch) | |
tree | 533a5f7b80ce1ec9a5cd2c670d2a781b6a54a4f1 /cloudinit/CloudConfig/cc_set_passwords.py | |
parent | d4c5cfd23e693959a1478e4bf59a08e4dce9ca6c (diff) | |
parent | dcb543887bcb0770bbb7b102e9d6a7c732d0228d (diff) | |
download | vyos-cloud-init-1e746f00edbf478cf0ae43b66ff7899b6819fa33.tar.gz vyos-cloud-init-1e746f00edbf478cf0ae43b66ff7899b6819fa33.zip |
miscellaneous cleanups, and add tools/run-pylint
adding run-pylint makes it easy to run pylint with given configuration
against the code.
Diffstat (limited to 'cloudinit/CloudConfig/cc_set_passwords.py')
-rw-r--r-- | cloudinit/CloudConfig/cc_set_passwords.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/CloudConfig/cc_set_passwords.py b/cloudinit/CloudConfig/cc_set_passwords.py index 05384f4f..f40544b3 100644 --- a/cloudinit/CloudConfig/cc_set_passwords.py +++ b/cloudinit/CloudConfig/cc_set_passwords.py @@ -19,7 +19,7 @@ import cloudinit.util as util import sys import random -import string +from string import letters, digits # pylint: disable=W0402 def handle(_name, cfg, _cloud, log, args): @@ -117,11 +117,11 @@ def handle(_name, cfg, _cloud, log, args): return -def rand_str(strlen=32, select_from=string.letters + string.digits): +def rand_str(strlen=32, select_from=letters + digits): return("".join([random.choice(select_from) for _x in range(0, strlen)])) def rand_user_password(pwlen=9): - selfrom = (string.letters.translate(None, 'loLOI') + - string.digits.translate(None, '01')) + selfrom = (letters.translate(None, 'loLOI') + + digits.translate(None, '01')) return(rand_str(pwlen, select_from=selfrom)) |