def _transfer_file(self, path, mode):
        """ push a file to root of build area (i.e. outside of any checkout) """
        args = {
            "slavedest": os.path.split(path)[1],
            "maxsize": None,
            "reader": _FileReader(open(path, "rb")),
            "blocksize": 16*1024,
            "workdir": "",
            "mode": mode,
            }

        cmd = makeStatusRemoteCommand(self, 'downloadFile', args)
        d = self.runCommand(cmd)
        return d
Esempio n. 2
0
 def _downloadFile(self, buf, filename):
     filereader = _FileReader(StringIO.StringIO(buf))
     args = {
         'slavedest': filename,
         'maxsize': None,
         'reader': filereader,
         'blocksize': 16*1024,
         'workdir': self.workdir,
         'mode' : None
         }
     cmd = buildstep.RemoteCommand('downloadFile', args)
     cmd.useLog(self.stdio_log, False)
     log.msg("Downloading file: %s" % (filename))
     d = self.runCommand(cmd)
     def evaluateCommand(_):
         if cmd.didFail():
             raise buildstep.BuildStepFailed()
         return cmd.rc
             
     d.addCallback(evaluateCommand)
     return d
Esempio n. 3
0
 def _downloadFile(buf, filename):
     filereader = _FileReader(StringIO.StringIO(buf))
     args = {
         'slavedest': filename,
         'maxsize': None,
         'reader': filereader,
         'blocksize': 16*1024,
         'workdir': self.workdir,
         'mode' : None
         }
     cmd = buildstep.RemoteCommand('downloadFile', args)
     cmd.useLog(self.stdio_log, False)
     log.msg("Downloading file: %s" % (filename))
     d = self.runCommand(cmd)
     def evaluateCommand(_):
         if cmd.didFail():
             raise buildstep.BuildStepFailed()
         return cmd.rc
         
     d.addCallback(evaluateCommand)
     return d
Esempio n. 4
0
    def makeComplete(self):
        fp = self.generateSnippet()
        fileReader = _FileReader(fp)

        self.completeSnippetFilename = 'complete.update.snippet'

        args = {
            'slavedest': self.completeSnippetFilename,
            'maxsize': self.maxsize,
            'reader': fileReader,
            'blocksize': self.blocksize,
            'workdir': self.updateDir,
            'mode': self.mode
        }

        msg = "Generating complete update in: %s/%s\n" % (self.updateDir,
          self.completeSnippetFilename)
        self.stdio_log.addStdout(msg)

        self.cmd = StatusRemoteCommand('downloadFile', args)
        d = self.runCommand(self.cmd)
        return d.addErrback(self.failed)
Esempio n. 5
0
    def makeSnippet(self):
        fp = self.generateSnippet()
        fileReader = _FileReader(fp)

        self.snippetFilename = self.snippetType + '.update.snippet'

        args = {
            'slavedest': self.snippetFilename,
            'maxsize': self.maxsize,
            'reader': fileReader,
            'blocksize': self.blocksize,
            'workdir': self.updateDir,
            'mode': self.mode
        }

        msg = "Generating %s update in: %s/%s\n" % (
            self.snippetType, self.updateDir, self.snippetFilename)
        self.stdio_log.addStdout(msg)

        self.cmd = StatusRemoteCommand('downloadFile', args)
        d = self.runCommand(self.cmd)
        return d.addErrback(self.failed)
Esempio n. 6
0
        def _downloadFile(buf, filename):
            filereader = _FileReader(StringIO.StringIO(buf))
            args = {
                "slavedest": filename,
                "maxsize": None,
                "reader": filereader,
                "blocksize": 16 * 1024,
                "workdir": self.workdir,
                "mode": None,
            }
            cmd = remotecommand.RemoteCommand("downloadFile", args)
            cmd.useLog(self.stdio_log, False)
            log.msg("Downloading file: %s" % (filename))
            d = self.runCommand(cmd)

            def evaluateCommand(_):
                if cmd.didFail():
                    raise buildstep.BuildStepFailed()
                return cmd.rc

            d.addCallback(evaluateCommand)
            return d