rebuild geeqie
[oi-userland.git] / components / cluster / cluster-glue / patches / python3.patch
blob571c72a40ff41c1ad1f86ab026acdeaaf13a4d0a
1 --- cluster-glue-bdd95fd0f89f31b19fa46ffa0ea3f5022ebcd858/lib/plugins/stonith/external/riloe.orig
2 +++ cluster-glue-bdd95fd0f89f31b19fa46ffa0ea3f5022ebcd858/lib/plugins/stonith/external/riloe
3 @@ -35,7 +35,7 @@
4 import socket
5 import subprocess
6 import xml.dom.minidom
7 -import httplib
8 +import http.client as httplib
9 import time
10 import re
12 @@ -163,12 +163,12 @@
15 if cmd in info:
16 - print info[cmd]
17 + print(info[cmd])
18 sys.exit(0)
20 if cmd == 'getconfignames':
21 for arg in [ "hostlist", "ilo_hostname", "ilo_user", "ilo_password", "ilo_can_reset", "ilo_protocol", "ilo_powerdown_method", "ilo_proxyhost", "ilo_proxyport"]:
22 - print arg
23 + print(arg)
24 sys.exit(0)
26 if not rihost:
27 @@ -344,13 +344,13 @@
28 return h
29 else:
30 return httplib.HTTPSConnection(host)
31 - except socket.gaierror, msg:
32 + except socket.gaierror as msg:
33 fatal("%s: %s" %(msg,host))
34 - except socket.sslerror, msg:
35 + except socket.sslerror as msg:
36 fatal("%s for %s" %(msg,host))
37 - except socket.error, msg:
38 + except socket.error as msg:
39 fatal("%s while talking to %s" %(msg,host))
40 - except ImportError, msg:
41 + except ImportError as msg:
42 fatal("ssl support missing (%s)" %msg)
44 def send_request(req,proc_f):
45 @@ -364,7 +364,7 @@
46 c = open_ilo(rihost)
47 try:
48 c.send(req+'\r\n')
49 - except socket.error, msg:
50 + except socket.error as msg:
51 fatal("%s, while talking to %s" %(msg,rihost))
52 t_end = time.time()
53 my_debug("request sent in %0.2f s" % ((t_end-t_begin)))
54 @@ -377,7 +377,7 @@
55 if not reply:
56 break
57 result.append(reply)
58 - except socket.error, msg:
59 + except socket.error as msg:
60 if msg[0] == 6: # connection closed
61 break
62 my_err("%s, while talking to %s" %(msg,rihost))
63 @@ -393,7 +393,7 @@
64 reply = re.sub("<(RIBCL.*)/>", r"<\1>", reply)
65 try:
66 doc = xml.dom.minidom.parseString(reply)
67 - except xml.parsers.expat.ExpatError,msg:
68 + except xml.parsers.expat.ExpatError as msg:
69 fatal("malformed response: %s\n%s"%(msg,reply))
70 rc = proc_f(doc)
71 doc.unlink()
72 --- cluster-glue-bdd95fd0f89f31b19fa46ffa0ea3f5022ebcd858/lib/plugins/stonith/ribcl.py.in.orig
73 +++ cluster-glue-bdd95fd0f89f31b19fa46ffa0ea3f5022ebcd858/lib/plugins/stonith/ribcl.py.in
74 @@ -18,7 +18,7 @@
76 import sys
77 import socket
78 -from httplib import *
79 +from http.client import *
80 from time import sleep
83 @@ -29,7 +29,7 @@
84 host = argv[1].split('.')[0]+'-rm'
85 cmd = argv[2]
86 except IndexError:
87 - print "Not enough arguments"
88 + print("Not enough arguments")
89 sys.exit(1)
92 @@ -66,7 +66,7 @@
93 else:
94 acmds.append(login + todo[cmd] + logout)
95 except KeyError:
96 - print "Invalid command: "+ cmd
97 + print("Invalid command: "+ cmd)
98 sys.exit(1)
101 @@ -88,13 +88,13 @@
102 sleep(1)
105 -except socket.gaierror, msg:
106 - print msg
107 +except socket.gaierror as msg:
108 + print(msg)
109 sys.exit(1)
110 -except socket.sslerror, msg:
111 - print msg
112 +except socket.sslerror as msg:
113 + print(msg)
114 sys.exit(1)
115 -except socket.error, msg:
116 - print msg
117 +except socket.error as msg:
118 + print(msg)
119 sys.exit(1)
121 --- cluster-glue-bdd95fd0f89f31b19fa46ffa0ea3f5022ebcd858/lib/plugins/stonith/external/ibmrsa-telnet.orig
122 +++ cluster-glue-bdd95fd0f89f31b19fa46ffa0ea3f5022ebcd858/lib/plugins/stonith/external/ibmrsa-telnet
123 @@ -305,7 +305,7 @@
124 func = getattr(self, cmd, self.not_implemented)
125 rc = func()
126 return(rc)
127 - except Exception, args:
128 + except Exception as args:
129 self.echo_log("err", 'Exception raised:', str(args))
130 if self._connection:
131 self.echo_log("err", self._connection.get_history())
132 --- cluster-glue-bdd95fd0f89f31b19fa46ffa0ea3f5022ebcd858/lib/plugins/stonith/external/dracmc-telnet.orig
133 +++ cluster-glue-bdd95fd0f89f31b19fa46ffa0ea3f5022ebcd858/lib/plugins/stonith/external/dracmc-telnet
134 @@ -200,7 +200,7 @@
135 self._parameters['cyclades_port'])
136 c.login(self._parameters['username'],
137 self._parameters['password'])
138 - except Exception, args:
139 + except Exception as args:
140 if "Connection reset by peer" in str(args):
141 self._echo_debug("Someone is already logged in... retry=%s" % tries)
142 c.close()
143 @@ -362,7 +362,7 @@
144 func = getattr(self, cmd, self.not_implemented)
145 rc = func()
146 return(rc)
147 - except Exception, args:
148 + except Exception as args:
149 self.echo_log("err", 'Exception raised:', str(args))
150 if self._connection:
151 self.echo_log("err", self._connection.get_history())