run everything in either local shell (shell=true), or remote shell (ssh). this it to allow external shell piping

This commit is contained in:
Edwin Eefting
2021-05-09 10:56:30 +02:00
parent 521d1078bd
commit 086cfe570b
4 changed files with 41 additions and 45 deletions

View File

@ -557,17 +557,17 @@ class ZfsDataset:
cmd.append(self.name)
# #add custom output pipes?
#local so do our own piping
if self.zfs_node.is_local():
output_pipe = self.zfs_node.run(cmd, pipe=True, readonly=True)
for pipe_cmd in output_pipes:
output_pipe=self.zfs_node.run(pipe_cmd.split(" "), inp=output_pipe, pipe=True, readonly=False)
#remote, so add with actual | and let remote shell handle it
else:
for pipe_cmd in output_pipes:
cmd.append("|")
cmd.extend(pipe_cmd.split(" "))
output_pipe = self.zfs_node.run(cmd, pipe=True, readonly=True)
# #local so do our own piping
# if self.zfs_node.is_local():
# output_pipe = self.zfs_node.run(cmd, pipe=True, readonly=True)
# for pipe_cmd in output_pipes:
# output_pipe=self.zfs_node.run(pipe_cmd.split(" "), inp=output_pipe, pipe=True, readonly=False)
# #remote, so add with actual | and let remote shell handle it
# else:
# for pipe_cmd in output_pipes:
# cmd.append("|")
# cmd.extend(pipe_cmd.split(" "))
output_pipe = self.zfs_node.run(cmd, pipe=True, readonly=True)
return output_pipe