@@ -79,7 +79,7 @@ def main(argv):
79
79
command = ["voms-proxy-info" , "-file" , str (proxy )]
80
80
p = subprocess .Popen (command , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
81
81
out , _err = p .communicate ()
82
- proxyInfo = [line for line in out .split ('\n ' ) if line ]
82
+ proxyInfo = [line for line in out .split (b '\n ' ) if line ]
83
83
processTimeLeft (sendMail , verbose , proxyInfo , time , mail )
84
84
85
85
if myproxy :
@@ -88,7 +88,7 @@ def main(argv):
88
88
command = ["myproxy-info" , "-v" , "-l" , "amaltaro" , "-s" , "myproxy.cern.ch" , "-k" , "amaltaroCERN" ]
89
89
p = subprocess .Popen (command , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
90
90
out , err = p .communicate ()
91
- proxyInfo = [line for line in out .split ('\n ' ) if line ]
91
+ proxyInfo = [line for line in out .split (b '\n ' ) if line ]
92
92
processTimeLeft (sendMail , verbose , proxyInfo , time , mail )
93
93
94
94
@@ -121,10 +121,10 @@ def processTimeLeft(sendMail, verbose, proxyInfo, time, mail):
121
121
print ('Proxy information: {}' .format (proxyInfo ))
122
122
timeLeft = []
123
123
for line in proxyInfo :
124
- if line .find ('timeleft' ) > - 1 :
125
- dateReg = re .compile ('\d{1,3}[:/]\d{2}[:/]\d{2}' )
124
+ if line .find (b 'timeleft' ) > - 1 :
125
+ dateReg = re .compile (b '\d{1,3}[:/]\d{2}[:/]\d{2}' )
126
126
timeLeft = dateReg .findall (line )[0 ]
127
- timeLeft = timeLeft .split (':' )[0 ]
127
+ timeLeft = timeLeft .split (b ':' )[0 ]
128
128
continue
129
129
else :
130
130
msg = "No valid proxy found in %s. " % HOST
0 commit comments