diff --git a/letsencrypt/client/CONFIG.py b/letsencrypt/client/CONFIG.py index 832b5b4ce..8c7c4b6d4 100644 --- a/letsencrypt/client/CONFIG.py +++ b/letsencrypt/client/CONFIG.py @@ -40,13 +40,13 @@ NONCE_SIZE = 16 RSA_KEY_SIZE = 2048 # bits of hashcash to generate -difficulty = 23 +difficulty = 23 # Let's Encrypt cert and chain files CERT_PATH = CERT_DIR + "cert-letsencrypt.pem" CHAIN_PATH = CERT_DIR + "chain-letsencrypt.pem" -#Invalid Extension +#Invalid Extension INVALID_EXT = ".acme.invalid" # Challenge Preferences Dict for currently supported challenges diff --git a/letsencrypt/client/acme.py b/letsencrypt/client/acme.py index 306ee9171..70a5982ad 100755 --- a/letsencrypt/client/acme.py +++ b/letsencrypt/client/acme.py @@ -19,9 +19,9 @@ def acme_object_validate(j): j = json.loads(j) if not isinstance(j, dict): raise jsonschema.ValidationError("this is not a dictionary object") - if not j.has_key("type"): + if "type" not in j: raise jsonschema.ValidationError("missing type field") - if not schemata.has_key(j["type"]): + if j["type"] not in schemata: raise jsonschema.ValidationError("unknown type %s" % j["type"]) jsonschema.validate(j, schemata[j["type"]]) diff --git a/letsencrypt/client/challenge.py b/letsencrypt/client/challenge.py index a25e60be0..2ccf9406f 100644 --- a/letsencrypt/client/challenge.py +++ b/letsencrypt/client/challenge.py @@ -10,4 +10,3 @@ class Challenge(object): logger.error("Error - base class challenge.generate_response()") def clean(self): logger.error("Error - base class challenge.clean()") - diff --git a/letsencrypt/client/client.py b/letsencrypt/client/client.py index 0f625804d..198c4139c 100755 --- a/letsencrypt/client/client.py +++ b/letsencrypt/client/client.py @@ -688,7 +688,7 @@ class Client(object): def sanity_check_names(self, names): for name in names: if not self.is_hostname_sane(name): - logger.fatal(`name` + " is an impossible hostname") + logger.fatal(repr(name) + " is an impossible hostname") sys.exit(81) def is_hostname_sane(self, hostname): diff --git a/letsencrypt/client/configurator.py b/letsencrypt/client/configurator.py index 6f5aabf58..c5b0e1f92 100644 --- a/letsencrypt/client/configurator.py +++ b/letsencrypt/client/configurator.py @@ -907,12 +907,12 @@ LogLevel warn \n\ Enables mod_ssl """ try: - # Use check_output so the command will finish before reloading + # Use check_output so the command will finish before reloading subprocess.check_call(["sudo", "a2enmod", mod_name], stdout=open("/dev/null", 'w'), stderr=open("/dev/null", 'w')) # Hopefully this waits for output subprocess.check_call(["sudo", "/etc/init.d/apache2", "restart"], stdout=open("/dev/null", 'w'), stderr=open("/dev/null", 'w')) except: - logger.error("Error enabling mod_" + mod_name) + logger.error("Error enabling mod_" + mod_name) sys.exit(1) def fnmatch_to_re(self, cleanFNmatch): diff --git a/letsencrypt/client/logger.py b/letsencrypt/client/logger.py index b285c2359..86a8da846 100644 --- a/letsencrypt/client/logger.py +++ b/letsencrypt/client/logger.py @@ -168,8 +168,3 @@ if __name__ == "__main__": logger.error("errrrr") logger.trace("some trace data: %d - %f - %s" % (5, 8.3, 'cows')) - - - - - diff --git a/letsencrypt/client/payment_challenge.py b/letsencrypt/client/payment_challenge.py index 773975d68..e3c4494d5 100644 --- a/letsencrypt/client/payment_challenge.py +++ b/letsencrypt/client/payment_challenge.py @@ -43,4 +43,3 @@ class Payment_Challenge(Challenge): def formatted_reasons(self): return "\n\t* %s\n" % self.reason -