]> p2p-next.cs.pub.ro Git - cs-p2p-next.git/commitdiff
autorun: "port" exception related code to Python 2.5
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Thu, 15 Apr 2010 08:42:10 +0000 (11:42 +0300)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Thu, 15 Apr 2010 08:43:16 +0000 (11:43 +0300)
autorun/commander/Commander.py
autorun/commander/SSHCommander.py
autorun/commander/XMLParser.py

index ccf595e4ddaa745d23c4d022a4ce83dacd25087c..83effecd44a5b5be5424326b181b413c7419fa6e 100644 (file)
@@ -27,7 +27,7 @@ class Commander(Thread):
                        self.sshc.connect(hostname=hostname,  username=username, port=port)
                        stdin, stdout, stderr = self.sshc.exec_command(comm)
                        print stdout.readlines()
-               except Exception as e:
+               except Exception, e:
                        print e
                finally:
                        self.sshc.close()
@@ -37,7 +37,7 @@ class Commander(Thread):
                        self.sshc.connect(hostname=hostname,  username=username, port=port)
                        for c in comms:
                                stdin, stdout, stderr = self.sshc.exec_command(comm)
-               except Exception as e:
+               except Exception, e:
                        print e
                finally: 
                        self.sshc.close()
@@ -51,7 +51,7 @@ class Commander(Thread):
                                self.sendMsg(pickle.dumps(config_data))
                                response = self.recvMsg()
                        print "->>>>>>>>>>>>>>>>>>>>>>>>>", response
-               except Exception as e:
+               except Exception, e:
                        print e
                finally:
                        self.sock.close()
index 5130f8baca915f9a346e8aeb941d2245df17c77a..b8944aed0770e98ef732b2124d2b608610e54ffe 100644 (file)
@@ -20,7 +20,7 @@ class SSHCommander:
                        self.sshclient.connect(hostname=self.hostname, username=self.username, pkey=self.pkey, port=self.port)
                        #self.channel = self.sshclient.opensession();
                        #self.sshclient.connect(username=self.username, pkey=self.pkey)
-               except Exception as e:
+               except Exception, e:
                        print e
                        self.sshclient.close()
 
@@ -29,7 +29,7 @@ class SSHCommander:
                        #self.channel = self.sshclient.open_session();
                        stdin, stdout, stderr = self.sshclient.exec_command(comm)
                        print stdout.readlines()
-               except Exception as e:
+               except Exception, e:
                        print e
                        self.sshclient.close()  
 
index 25be3afed4317dccf278ec75abb7ad5c08923dd7..3c8f6fa916ffcdea111945af9849e3e42fab5d04 100644 (file)
@@ -56,7 +56,7 @@ class Nodes:
                                        client_paths [client_id]=elem2[0].text;
                                list.append(client_paths);
                                self.nodes.append(Node(id, list))
-               except IOError as e:
+               except IOError, e:
                        print e
                        return None
        
@@ -85,7 +85,7 @@ class Swarm:
                                id = elem.get("id")
                                list = [elem2.text for elem2 in elem[:len(elem)-1]]
                                self.swarm.append(SwarmInstance(id, list))
-               except IOError as e:
+               except IOError, e:
                        print e
                        return None