def main()

in Shared_Processors/Rsync.py [0:0]


    def main(self):
        rsync_location = self.env.get("rsync_path", "/usr/bin/rsync")
        rsync_args = self.env.get("rsync_arguments", [])
        if isinstance(rsync_args, basestring):
            raise ProcessorError("rsync_args must be a list!")
        cmd = [rsync_location]
        if rsync_args:
            cmd.extend(rsync_args)
        cmd.extend([self.env["source_path"], self.env["destination_path"]])
        proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        (rout, rerr) = proc.communicate()
        if rerr:
            raise ProcessorError(rerr)
        self.output(rout)