From b6b3f849901086b5ab1a321300d09b9ca67a8c32 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Wed, 3 May 2017 12:43:32 +0530 Subject: [PATCH] Pep8 fixes for htpasswd (#24230) Signed-off-by: Abhijeet Kasurde --- lib/ansible/modules/web_infrastructure/htpasswd.py | 6 +++--- test/sanity/pep8/legacy-files.txt | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/web_infrastructure/htpasswd.py b/lib/ansible/modules/web_infrastructure/htpasswd.py index 0e675c9de7..191e7614da 100644 --- a/lib/ansible/modules/web_infrastructure/htpasswd.py +++ b/lib/ansible/modules/web_infrastructure/htpasswd.py @@ -131,7 +131,7 @@ def present(dest, username, password, crypt_scheme, create, check_mode): if crypt_scheme in apache_hashes: context = htpasswd_context else: - context = CryptContext(schemes = [ crypt_scheme ] + apache_hashes) + context = CryptContext(schemes=[crypt_scheme] + apache_hashes) if not os.path.exists(dest): if not create: raise ValueError('Destination %s does not exist' % dest) @@ -254,7 +254,7 @@ def main(): path = temp.name f = open(path, "w") try: - [ f.write(line) for line in lines if line.strip() ] + [f.write(line) for line in lines if line.strip()] finally: f.close() @@ -264,7 +264,7 @@ def main(): elif state == 'absent': if not os.path.exists(path): module.exit_json(msg="%s not present" % username, - warnings="%s does not exist" % path, changed=False) + warnings="%s does not exist" % path, changed=False) (msg, changed) = absent(path, username, check_mode) else: module.fail_json(msg="Invalid state: %s" % state) diff --git a/test/sanity/pep8/legacy-files.txt b/test/sanity/pep8/legacy-files.txt index 3aee7d60b1..dc6850fe7d 100644 --- a/test/sanity/pep8/legacy-files.txt +++ b/test/sanity/pep8/legacy-files.txt @@ -769,7 +769,6 @@ lib/ansible/modules/web_infrastructure/ansible_tower/tower_team.py lib/ansible/modules/web_infrastructure/ansible_tower/tower_user.py lib/ansible/modules/web_infrastructure/deploy_helper.py lib/ansible/modules/web_infrastructure/ejabberd_user.py -lib/ansible/modules/web_infrastructure/htpasswd.py lib/ansible/modules/web_infrastructure/jboss.py lib/ansible/modules/web_infrastructure/jira.py lib/ansible/modules/windows/win_disk_image.py