aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-06-27 15:50:48 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-06-27 15:51:34 +0200
commitf8cdcd5c2dd6ab6a824d2c03334cda6dd9de852c (patch)
treef5fec22cb2b6a15b9b3976988b569d64a18b1340
parent6f1e9ee7f1ef614fa27db5b377a1f16d14799a25 (diff)
downloadstandardskriver-f8cdcd5c2dd6ab6a824d2c03334cda6dd9de852c.zip
standardskriver-f8cdcd5c2dd6ab6a824d2c03334cda6dd9de852c.tar.gz
standardskriver-f8cdcd5c2dd6ab6a824d2c03334cda6dd9de852c.tar.bz2
standardskriver: Fix bytes vs. str mess after Python3 porting.
-rwxr-xr-xstandardskriver8
1 files changed, 4 insertions, 4 deletions
diff --git a/standardskriver b/standardskriver
index bf61898..26d5e0d 100755
--- a/standardskriver
+++ b/standardskriver
@@ -95,7 +95,7 @@ cfg.OPTCRE = re.compile(
# by any # space/tab
r'(?P<value>.*)$' # everything up to eol
)
-cfg.readfp(open(CFG_FILE, 'rb'))
+cfg.readfp(open(CFG_FILE, 'r'))
if cfg.get('settings', 'enable') != "yes":
sys.exit(0)
@@ -117,15 +117,15 @@ except KeyError:
pass
p = subprocess.Popen(['/sbin/ifconfig'], env={'LANG': 'C'}, stdout=subprocess.PIPE)
for line in p.stdout:
- m = re_ipaddr.search(line)
+ m = re_ipaddr.search(line.decode())
if m:
ipaddrs.append(m.group(1))
p.wait()
p = subprocess.Popen(['id', '-Gn'], stdout=subprocess.PIPE)
-groups = p.stdout.read().split()
+groups = [ g.decode() for g in p.stdout.read().split() ]
p.wait()
-#print groups
+#print (groups)
def get_group_match():
group_sections = ['groups']