1 --- cluster-glue-bdd95fd0f89f31b19fa46ffa0ea3f5022ebcd858/lib/plugins/stonith/external/riloe.orig
2 +++ cluster-glue-bdd95fd0f89f31b19fa46ffa0ea3f5022ebcd858/lib/plugins/stonith/external/riloe
8 +import http.client as httplib
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"]:
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):
49 - except socket.error, msg:
50 + except socket.error as msg:
51 fatal("%s, while talking to %s" %(msg,rihost))
53 my_debug("request sent in %0.2f s" % ((t_end-t_begin)))
58 - except socket.error, msg:
59 + except socket.error as msg:
60 if msg[0] == 6: # connection closed
62 my_err("%s, while talking to %s" %(msg,rihost))
64 reply = re.sub("<(RIBCL.*)/>", r"<\1>", reply)
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))
72 --- cluster-glue-bdd95fd0f89f31b19fa46ffa0ea3f5022ebcd858/lib/plugins/stonith/ribcl.py.in.orig
73 +++ cluster-glue-bdd95fd0f89f31b19fa46ffa0ea3f5022ebcd858/lib/plugins/stonith/ribcl.py.in
78 -from httplib import *
79 +from http.client import *
80 from time import sleep
84 host = argv[1].split('.')[0]+'-rm'
87 - print "Not enough arguments"
88 + print("Not enough arguments")
94 acmds.append(login + todo[cmd] + logout)
96 - print "Invalid command: "+ cmd
97 + print("Invalid command: "+ cmd)
105 -except socket.gaierror, msg:
107 +except socket.gaierror as msg:
110 -except socket.sslerror, msg:
112 +except socket.sslerror as msg:
115 -except socket.error, msg:
117 +except socket.error as msg:
121 --- cluster-glue-bdd95fd0f89f31b19fa46ffa0ea3f5022ebcd858/lib/plugins/stonith/external/ibmrsa-telnet.orig
122 +++ cluster-glue-bdd95fd0f89f31b19fa46ffa0ea3f5022ebcd858/lib/plugins/stonith/external/ibmrsa-telnet
124 func = getattr(self, cmd, self.not_implemented)
127 - except Exception, args:
128 + except Exception as args:
129 self.echo_log("err", 'Exception raised:', str(args))
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
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)
144 func = getattr(self, cmd, self.not_implemented)
147 - except Exception, args:
148 + except Exception as args:
149 self.echo_log("err", 'Exception raised:', str(args))
151 self.echo_log("err", self._connection.get_history())