diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-01-17 12:34:19 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-01-17 12:34:19 -0500 |
commit | c33eedb47b2b22c797051da197fd80e74f1db179 (patch) | |
tree | f1958cfc36e53fc406fea4963b1305f760570847 /cloudinit/CloudConfig/cc_set_passwords.py | |
parent | 89eafa0a6c1a28331b3b3c59ba94803052c63583 (diff) | |
download | vyos-cloud-init-c33eedb47b2b22c797051da197fd80e74f1db179.tar.gz vyos-cloud-init-c33eedb47b2b22c797051da197fd80e74f1db179.zip |
[PATCH 2/4] Fix pylint conventions C0322 (operator not preceded by a space)
From: Juerg Haefliger <juerg.haefliger@hp.com>
Diffstat (limited to 'cloudinit/CloudConfig/cc_set_passwords.py')
-rw-r--r-- | cloudinit/CloudConfig/cc_set_passwords.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cloudinit/CloudConfig/cc_set_passwords.py b/cloudinit/CloudConfig/cc_set_passwords.py index 07e3ca1b..4059e9c1 100644 --- a/cloudinit/CloudConfig/cc_set_passwords.py +++ b/cloudinit/CloudConfig/cc_set_passwords.py @@ -70,7 +70,7 @@ def handle(_name,cfg,_cloud,log,args): '\n'.join(randlist) )) if expire: - enum=len(errors) + enum = len(errors) for u in users: try: util.subp(['passwd', '--expire', u]) @@ -83,13 +83,13 @@ def handle(_name,cfg,_cloud,log,args): if 'ssh_pwauth' in cfg: val = str(cfg['ssh_pwauth']).lower() if val in ( "true", "1", "yes"): - pw_auth="yes" - change_pwauth=True + pw_auth = "yes" + change_pwauth = True elif val in ( "false", "0", "no"): - pw_auth="no" - change_pwauth=True + pw_auth = "no" + change_pwauth = True else: - change_pwauth=False + change_pwauth = False if change_pwauth: pa_s = "\(#*\)\(PasswordAuthentication[[:space:]]\+\)\(yes\|no\)" @@ -118,7 +118,7 @@ def rand_str(strlen=32, select_from=string.letters+string.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 = (string.letters.translate(None,'loLOI') + + string.digits.translate(None,'01')) return(rand_str(pwlen,select_from=selfrom)) |