From 01a06be09101888f2ea69265ff414b5d5f0c02c3 Mon Sep 17 00:00:00 2001 From: James Kasten Date: Sat, 29 Nov 2014 01:05:06 -0800 Subject: [PATCH] Fixed a few PEP8 violations --- letsencrypt/client/apache_configurator.py | 18 +++++++++--------- letsencrypt/client/augeas_configurator.py | 2 +- letsencrypt/client/client.py | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/letsencrypt/client/apache_configurator.py b/letsencrypt/client/apache_configurator.py index 44104cb37..2cd2965de 100644 --- a/letsencrypt/client/apache_configurator.py +++ b/letsencrypt/client/apache_configurator.py @@ -320,11 +320,11 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): """ name_match = self.aug.match(("%s//*[self::directive=~regexp('%s')] | " - "%s//*[self::directive=~regexp('%s')]" % - (host.path, - case_i('ServerName'), - host.path, - case_i('ServerAlias')))) + "%s//*[self::directive=~regexp('%s')]" % + (host.path, + case_i('ServerName'), + host.path, + case_i('ServerAlias')))) for name in name_match: args = self.aug.match(name + "/*") for arg in args: @@ -593,8 +593,8 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): % (start, directive))) else: matches = self.aug.match(("%s//*[self::directive=~regexp('%s')]/*" - "[self::arg=~regexp('%s')]" % - (start, directive, arg))) + "[self::arg=~regexp('%s')]" % + (start, directive, arg))) includes = self.aug.match(("%s//* [self::directive=~regexp('%s')]/* " "[label()='arg']" % @@ -669,7 +669,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): # Turn it into a augeas regex # TODO: Can this instead be an augeas glob instead of regex split_arg[idx] = ("* [label()=~regexp('%s')]" % - self.fnmatch_to_re(split)) + self.fnmatch_to_re(split)) # Reassemble the argument arg = "/".join(split_arg) @@ -1557,6 +1557,7 @@ def strip_dir(path): # No directory return "" + def dvsni_get_cert_file(nonce): """Returns standardized name for challenge certificate. @@ -1620,7 +1621,6 @@ def dvsni_gen_ext(dvsni_r, dvsni_s): return z_base.hexdigest() + CONFIG.INVALID_EXT - def main(): """ Main function used for quick testing purposes """ diff --git a/letsencrypt/client/augeas_configurator.py b/letsencrypt/client/augeas_configurator.py index c894852ab..13369ee7f 100644 --- a/letsencrypt/client/augeas_configurator.py +++ b/letsencrypt/client/augeas_configurator.py @@ -423,7 +423,7 @@ def finalize_checkpoint(cp_dir, title): changes_tmp.write("-- %s --\n" % title) with open(cp_dir + "CHANGES_SINCE", 'r') as changes_orig: changes_tmp.write(changes_orig.read()) - shutil.move(os.path.join(cp_dir, "CHANGES_SINCE.tmp"), + shutil.move(os.path.join(cp_dir, "CHANGES_SINCE.tmp"), os.path.join(cp_dir, "CHANGES_SINCE")) except: logger.error("Unable to finalize checkpoint - adding title") diff --git a/letsencrypt/client/client.py b/letsencrypt/client/client.py index 3b4070f28..89119b014 100644 --- a/letsencrypt/client/client.py +++ b/letsencrypt/client/client.py @@ -44,7 +44,7 @@ class Client(object): CONFIG.SERVER_ROOT) self.server = ca_server - + if cert_signing_request: self.csr_file = cert_signing_request.name else: