1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmdbusd: Ensure lvm shell still exists

This commit is contained in:
Tony Asleson 2016-10-07 13:45:30 -05:00
parent 088b3d036a
commit 2e941beb44

View File

@ -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))