From e469ae4ed89fce29f1b74926caa3177aeea4bf6e Mon Sep 17 00:00:00 2001 From: Seth Schoen Date: Thu, 14 May 2015 12:27:52 -0700 Subject: [PATCH] Remove magic constant --- letsencrypt/storage.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/letsencrypt/storage.py b/letsencrypt/storage.py index ee08ba5cd..c7b4dfb55 100644 --- a/letsencrypt/storage.py +++ b/letsencrypt/storage.py @@ -41,7 +41,8 @@ class RenewableCert(object): # pylint: disable=too-many-instance-attributes if isinstance(configfile, configobj.ConfigObj): if not os.path.basename(configfile.filename).endswith(".conf"): raise ValueError("renewal config file name must end in .conf") - self.lineagename = os.path.basename(configfile.filename)[:-5] + self.lineagename = os.path.basename( + configfile.filename)[:-len(".conf")] else: raise TypeError("RenewableCert config must be ConfigObj object") @@ -334,7 +335,7 @@ class RenewableCert(object): # pylint: disable=too-many-instance-attributes raise ValueError("renewal config file name must end in .conf") # lineagename will now potentially be modified based on what # renewal configuration file could actually be created - lineagename = os.path.basename(config_filename)[:-5] + lineagename = os.path.basename(config_filename)[:-len(".conf")] archive = os.path.join(archive_dir, lineagename) live_dir = os.path.join(live_dir, lineagename) if os.path.exists(archive):