migrate things to python3
authorRalf Jung <post@ralfj.de>
Tue, 3 Jan 2023 12:37:44 +0000 (13:37 +0100)
committerRalf Jung <post@ralfj.de>
Tue, 3 Jan 2023 12:37:44 +0000 (13:37 +0100)
roles/apache/files/log-anon
roles/apache/tasks/main.yml
roles/email/tasks/dovecot.yml
roles/email/templates/changepw
roles/email/templates/newmail/newmail

index 32b6c1e58b61d417495b463b82a37bec71a2fd64..0b8466832f1b8e21494fbe2b37c600a5e1061f06 100644 (file)
@@ -1,9 +1,9 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 import sys, re
 from netaddr import IPAddress, AddrFormatError
 
 if len(sys.argv) != 2:
-       print >>sys.stderr, "Usage: %s filename" % sys.argv[0]
+       print("Usage: %s filename" % sys.argv[0], file=sys.stderr)
        sys.exit(1)
 
 log = open(sys.argv[1], "a")
index 6878845d87552c709d8c52abd25322272d01945c..8d1382c179fc857faaa5d0d36fd6acb615f6acac 100644 (file)
@@ -1,5 +1,5 @@
 - name: install apache
-  apt: name=apache2,python-netaddr state=latest
+  apt: name=apache2,python3-netaddr state=latest
 - name: enable apache
   service: name=apache2 enabled=yes
 # apache config
index 5d8ef0c38f051744879021508f2a84d821d24f02..1766ede7caa9f4fefbe9b6167a0c69e5d5f3db6a 100644 (file)
@@ -1,5 +1,5 @@
 - name: install dovecot
-  apt: name=dovecot-imapd,dovecot-lmtpd,dovecot-mysql,dovecot-pop3d,dovecot-sieve,dovecot-managesieved state=latest
+  apt: name=dovecot-imapd,dovecot-lmtpd,dovecot-mysql,dovecot-pop3d,dovecot-sieve,dovecot-managesieved,python3-mysqldb state=latest
 - name: enable dovecot
   service: name=dovecot enabled=yes
 # configuration
index 96eef60078492b36fdc1ad3451e7b8793b0811db..7a1b6003ffbd44176d69402300aa46f46d7aeea9 100644 (file)
@@ -1,5 +1,5 @@
-#!/usr/bin/env python2
-from __future__ import print_function
+#!/usr/bin/env python3
+
 import os, cgi, MySQLdb, subprocess, time
 
 # settings
index 86a1d99de21dc73e0f33d8aac0883327d49f11fc..4f3785909c30159c4b91b8915aabd31b5b8a4e2b 100755 (executable)
@@ -1,8 +1,8 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
-from __future__ import print_function
+
 import sys, os, random, MySQLdb, subprocess, time, string, argparse
-import urllib, smtplib, email.mime.text, email.utils
+import smtplib, email.mime.text, email.utils
 from settings import *
 from templates import *