diff options
author | Tony Asleson <tasleson@redhat.com> | 2016-10-07 13:45:30 -0500 |
---|---|---|
committer | Tony Asleson <tasleson@redhat.com> | 2016-10-10 16:31:00 -0500 |
commit | 2e941beb446e71a9278e38eb4d69e19dc4b284f8 (patch) | |
tree | 4b01a1f18e387805ad525438492f29c22ed79224 | |
parent | 088b3d036a73a7d947f6e9b12e8fad8a9f40d97f (diff) | |
download | lvm2-2e941beb446e71a9278e38eb4d69e19dc4b284f8.tar.gz |
lvmdbusd: Ensure lvm shell still exists
-rwxr-xr-x | daemons/lvmdbusd/lvm_shell_proxy.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/daemons/lvmdbusd/lvm_shell_proxy.py b/daemons/lvmdbusd/lvm_shell_proxy.py index 12e7e368d..e6154888e 100755 --- a/daemons/lvmdbusd/lvm_shell_proxy.py +++ b/daemons/lvmdbusd/lvm_shell_proxy.py @@ -75,6 +75,8 @@ class LVMShellProxy(object): report += tmp.decode("utf-8") if len(tmp) != 16384: break + else: + break elif r == self.lvm_shell.stderr.fileno(): while True: @@ -84,6 +86,10 @@ class LVMShellProxy(object): else: break + # Check to see if the lvm process died on us + if self.lvm_shell.poll(): + raise Exception(self.lvm_shell.returncode, "%s" % stderr) + except IOError as ioe: log_debug(str(ioe)) pass @@ -171,6 +177,11 @@ class LVMShellProxy(object): error_msg = "" json_result = "" + if self.lvm_shell.poll(): + raise Exception( + self.lvm_shell.returncode, + "Underlying lvm shell process is not present!") + # create the command string cmd = " ".join(_quote_arg(arg) for arg in argv) cmd += "\n" @@ -222,7 +233,7 @@ if __name__ == "__main__": end = time.time() print(("RC: %d" % ret)) - # print(("OUT:\n%s" % out)) + print(("OUT:\n%s" % out)) print(("ERR:\n%s" % err)) print("Command = %f seconds" % (end - start)) |