X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=pcucontrol%2Fmodels%2FBayTech.py;fp=pcucontrol%2Fmodels%2FBayTech.py;h=5883c4b03fc3a69e7caff24b49d67e211616995e;hb=6dfabcd2ef4d6a9a4cf91e71fc5edfe8a005a417;hp=065cc28ac4f395bed902359d11fcdbf923e78541;hpb=9cae0ec50c0201aa21dad28413402037816744bd;p=monitor.git diff --git a/pcucontrol/models/BayTech.py b/pcucontrol/models/BayTech.py index 065cc28..5883c4b 100644 --- a/pcucontrol/models/BayTech.py +++ b/pcucontrol/models/BayTech.py @@ -123,8 +123,13 @@ class BayTechCtrlC(PCUControl): ssh_options="-o StrictHostKeyChecking=no -o PasswordAuthentication=yes -o PubkeyAuthentication=no" s = pxssh.pxssh() - if not s.login(self.host, self.username, self.password, ssh_options): - raise ExceptionPassword("Invalid Password") + try: + if not s.login(self.host, self.username, self.password, ssh_options): + raise ExceptionPassword("Invalid Password") + except pexpect.EOF: + raise ExceptionNoTransport("No Connection Possible") + + # Otherwise, the login succeeded. # Send a ctrl-c to the remote process.