Beispiel #1
0
 def receive(self,name,pipe,opts=None,bufsize=-1,compression=False):
     if not opts: opts = []
     cmd = list(self.command)
     if compression and cmd[0] == 'ssh': cmd.insert(1,"-C")
     cmd = cmd + ["receive"] + opts + [name]
     p = SpecialPopen(cmd,stdin=pipe,bufsize=bufsize)
     return p
Beispiel #2
0
 def send(self,name,opts=None,bufsize=-1,compression=False):
     if not opts: opts = []
     cmd = list(self.command)
     if compression and cmd[0] == 'ssh': cmd.insert(1,"-C")
     cmd = cmd + ["send"] + opts + [name]
     p = SpecialPopen(cmd,stdin=open(os.devnull),stdout=subprocess.PIPE,bufsize=bufsize)
     return p
 def receive(self,
             name,
             pipe,
             opts=None,
             bufsize=-1,
             compression=False,
             lockdataset=None):
     if not opts: opts = []
     cmd = list(self.command)
     if compression and cmd[0] == 'ssh': cmd.insert(1, "-C")
     if lockdataset is not None:
         cmd += ["zflock"]
         if self.verbose:
             cmd += ["-v"]
         cmd += [lockdataset, "--"]
     cmd = cmd + ["zfs", "receive"] + opts + [name]
     p = SpecialPopen(cmd, stdin=pipe, bufsize=bufsize)
     return p
 def send(self,
          name,
          opts=None,
          bufsize=-1,
          compression=False,
          lockdataset=None):
     if not opts: opts = []
     cmd = list(self.command)
     if compression and cmd[0] == 'ssh': cmd.insert(1, "-C")
     if lockdataset is not None:
         cmd += ["zflock"]
         if self.verbose:
             cmd += ["-v"]
         cmd += [lockdataset, "--"]
     cmd += ["zfs", "send"] + opts + [name]
     p = SpecialPopen(cmd,
                      stdin=file(os.devnull),
                      stdout=subprocess.PIPE,
                      bufsize=bufsize)
     return p