summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Eckersberg <jeckersb@redhat.com>2008-01-22 16:53:42 -0500
committerJohn Eckersberg <jeckersb@redhat.com>2008-01-22 16:53:42 -0500
commit7e40adbaba76448e54044893e7e49e8c224e86d0 (patch)
treee67919b6b25e55f1f58d7a5658f047522b118469
parentcd76994e964b315ebe274851d0f324ba74ad7381 (diff)
downloadfunc-7e40adbaba76448e54044893e7e49e8c224e86d0.tar.gz
func-7e40adbaba76448e54044893e7e49e8c224e86d0.tar.xz
func-7e40adbaba76448e54044893e7e49e8c224e86d0.zip
check return code on SSH to determine error or not
-rw-r--r--func/minion/modules/netapp/common.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/func/minion/modules/netapp/common.py b/func/minion/modules/netapp/common.py
index ab63cbc..d041336 100644
--- a/func/minion/modules/netapp/common.py
+++ b/func/minion/modules/netapp/common.py
@@ -2,7 +2,9 @@ import subprocess
SSH = '/usr/bin/ssh'
-class GenericSSHException(Exception): pass
+class GenericSSHError(Exception): pass
+class NetappCommandError(Exception): pass
+class NetappNotImplementedError(Exception): pass
def ssh(user, host, command):
cmd = subprocess.Popen([SSH, "%s@%s" % (user, host), command],
@@ -13,8 +15,7 @@ def ssh(user, host, command):
shell=False)
(out, err) = cmd.communicate()
-
- if err:
- raise GenericSSHException, err
+ if cmd.wait() != 0:
+ raise GenericSSHError, err
else:
return out