diff options
author | John Eckersberg <jeckersb@redhat.com> | 2008-01-22 16:53:42 -0500 |
---|---|---|
committer | John Eckersberg <jeckersb@redhat.com> | 2008-01-22 16:53:42 -0500 |
commit | 7e40adbaba76448e54044893e7e49e8c224e86d0 (patch) | |
tree | e67919b6b25e55f1f58d7a5658f047522b118469 /func/minion/modules/netapp | |
parent | cd76994e964b315ebe274851d0f324ba74ad7381 (diff) | |
download | third_party-func-7e40adbaba76448e54044893e7e49e8c224e86d0.tar.gz third_party-func-7e40adbaba76448e54044893e7e49e8c224e86d0.tar.xz third_party-func-7e40adbaba76448e54044893e7e49e8c224e86d0.zip |
check return code on SSH to determine error or not
Diffstat (limited to 'func/minion/modules/netapp')
-rw-r--r-- | func/minion/modules/netapp/common.py | 9 |
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 |