-#!/usr/bin/python
-#-*- coding:utf-8 -*-
+#!/usr/bin/env python3
# pylint: disable=invalid-name
"""Renew Let's Encrypt certs!
--webroot-path /var/www/rss/ -d rss.wh0rd.org
"""
-from __future__ import print_function
-
import argparse
-try:
- import configparser
-except ImportError:
- import ConfigParser as configparser
+import configparser
import cryptography.hazmat.backends
from cryptography import x509
-try:
- from cStringIO import StringIO
-except ImportError:
- from io import StringIO
import datetime
+import io
import logging
import logging.handlers
import os
path = os.path.join(LE_BASE, 'renewal', domain + '.conf')
# The config file format is almost enough for the configparser.
# We need to insert a section header for the first few items.
- fp = StringIO()
+ fp = io.StringIO()
fp.write('[globals]\n')
fp.write(open(path).read())
fp.seek(0)