import subprocess
import zope.component
-import zope.interface
+
+from zope.interface import implementer, provider
from letsencrypt import errors
from letsencrypt import interfaces
logger = logging.getLogger(__name__)
+@implementer(interfaces.IInstaller)
+@provider(interfaces.IPluginFactory)
class Installer(common.Plugin):
"""Hitch installer."""
- zope.interface.implements(interfaces.IInstaller)
- zope.interface.classProvides(interfaces.IPluginFactory)
description = "Hitch Installer"
hidden = True
# Actually write the full file.
filename = os.path.join(os.path.dirname(cert_path), "all.pem")
- fd = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0600)
+ fd = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600)
with os.fdopen(fd, 'w') as pem_file:
pem_file.write(pem)
# Now go check the config file to see if this file is already there.
found = False
last_pem_line = None
- for line_num in xrange(len(self.config)):
+ for line_num in range(len(self.config)):
m = re.match("^\s*pem-file\s*=\s*\"([^\"]+)\"", self.config[line_num])
if m:
last_pem_line = line_num
if temporary:
raise errors.PluginError("temporary is not implemented")
- with open("/etc/hitch/hitch.conf", "w") as config_file:
+ with open("/etc/hitch/hitch.conf", "w") as config_file:
config_file.writelines(self.config)
def rollback_checkpoints(self, rollback=1):