diff --git a/app/app.py b/app/app.py index 36c0c5d..1d46857 100644 --- a/app/app.py +++ b/app/app.py @@ -69,13 +69,13 @@ def reconfigure(version): # * com.df.letsencrypt.host # * com.df.letsencrypt.email required_labels = ('letsencrypt.host', 'letsencrypt.email') - if all([label in args.keys() for label in required_labels]): + if all([label in list(args.keys()) for label in required_labels]): logger.info('letsencrypt support enabled.') testing = None if 'letsencrypt.testing' in args: testing = args['letsencrypt.testing'] - if isinstance(testing, basestring): + if isinstance(testing, str): testing = True if testing.lower() == 'true' else False client.process(args['letsencrypt.host'].split(','), args['letsencrypt.email'], testing=testing) @@ -90,10 +90,10 @@ def reconfigure(version): logger.debug('forwarding request to docker-flow-proxy ({})'.format(t)) try: response = dfp_client.get(dfp_client.url(version, '/reconfigure?{}'.format( - '&'.join(['{}={}'.format(k, v) for k, v in request.args.items()])))) + '&'.join(['{}={}'.format(k, v) for k, v in list(request.args.items())])))) if response.status_code == 200: break - except Exception, e: + except Exception as e: logger.error('Error while trying to forward request: {}'.format(e)) logger.debug('waiting for retry') time.sleep(os.environ.get('RETRY_INTERVAL', 5)) diff --git a/app/client_dfple.py b/app/client_dfple.py index 0729775..a09d321 100644 --- a/app/client_dfple.py +++ b/app/client_dfple.py @@ -176,7 +176,7 @@ def process(self, domains, email, version='1', testing=None): self.dfp = self.services(self.dfp_service_name)[0] self.dfp_secrets = self.service_get_secrets(self.dfp) - for domain, certs in certs.items(): + for domain, certs in list(certs.items()): combined = [x for x in certs if '.pem' in x] if len(combined) == 0: diff --git a/app/client_dfple_tests.py b/app/client_dfple_tests.py index 705cf63..e5d7f59 100644 --- a/app/client_dfple_tests.py +++ b/app/client_dfple_tests.py @@ -292,5 +292,5 @@ def test_secret_created_not_attached(self): # check secrets found and attached for d in self.domains: self.assertTrue(any([d in x.name for x in self.client._secrets])) - print('ee', self.client.dfp_secrets) + print(('ee', self.client.dfp_secrets)) self.assertTrue(any(['{}.pem'.format(d) == x['SecretName'] for x in self.client.dfp_secrets])) \ No newline at end of file diff --git a/app/hooks/ovh/manual-auth-hook.py b/app/hooks/ovh/manual-auth-hook.py index b267488..54bb7a7 100644 --- a/app/hooks/ovh/manual-auth-hook.py +++ b/app/hooks/ovh/manual-auth-hook.py @@ -23,10 +23,10 @@ # update the _acme-challenge. subdomain with a TXT record subdomain = '_acme-challenge.{}'.format(CERTBOT_DOMAIN.replace(OVH_DNS_ZONE, ''))[:-1] zone = client.post('/domain/zone/{}/record'.format(OVH_DNS_ZONE), fieldType='TXT', subDomain=subdomain, target=CERTBOT_VALIDATION) -print "Record updated : {}".format(zone) +print("Record updated : {}".format(zone)) response = client.post('/domain/zone/{}/refresh'.format(OVH_DNS_ZONE)) -print "Zone refreshed : {}".format(response) +print("Zone refreshed : {}".format(response)) # sleep to make sure the change has time to propagate over to DNS time.sleep(60) \ No newline at end of file diff --git a/app/hooks/ovh/manual-cleanup-hook.py b/app/hooks/ovh/manual-cleanup-hook.py index 3f83bd3..e44ee56 100644 --- a/app/hooks/ovh/manual-cleanup-hook.py +++ b/app/hooks/ovh/manual-cleanup-hook.py @@ -22,13 +22,13 @@ # update the _acme-challenge. subdomain with a TXT record subdomain = '_acme-challenge.{}'.format(CERTBOT_DOMAIN.replace(OVH_DNS_ZONE, ''))[:-1] zones = client.get('/domain/zone/{}/record'.format(OVH_DNS_ZONE), fieldType='TXT', subDomain=subdomain) -print "zones", zones +print("zones", zones) if len(zones) == 1: zone = zones[0] else: raise Exception('Could not find domain matching: {}'.format(CERTBOT_DOMAIN)) response = client.delete('/domain/zone/{}/record/{}'.format(OVH_DNS_ZONE, zone)) -print "Record deleted : {}".format(response) +print("Record deleted : {}".format(response)) response = client.post('/domain/zone/{}/refresh'.format(OVH_DNS_ZONE)) -print "Zone refreshed : {}".format(response) +print("Zone refreshed : {}".format(response))