extras-buildsys/builder Builder.py,1.5,1.6

Daniel Williams (dcbw) fedora-extras-commits at redhat.com
Tue May 9 19:10:58 UTC 2006


Author: dcbw

Update of /cvs/fedora/extras-buildsys/builder
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29423/builder

Modified Files:
	Builder.py 
Log Message:
2006-05-09  Dan Williams  <dcbw at redhat.com>

    * builder/Builder.py
        - Handle the JobFiles request

    * common/Commands.py
        - Check arguments on PlgCommandJobFiles

    * server/ArchJob.py
        - pylint cleanups
        - Rework result files download code; archjob now requests result files
            from the builder, which knows how to handle builder-type specific
            result files operations
        - get_upload_dir() renamed to get_result_files_dir()

    * server/Builder.py
        - pylint cleanups
        - Move dispatching of common commands into the base Builder class
        - (_decompose_job_files_ack): new function; extract and return info
            from a JobFilesAck command
        - (_handle_job_files_ack): new function; handle a JobFilesAck in the
            builder-type specific manner.  For Active builders, we don't have
            to do much since the file was uploaded to us by the builder itself

    * server/BuilderManager.py
        - (any_prepping_builders): fix usage of builder.alive() -> builder.available()

    * server/PackageJob.py
        - Small cleanup of result files bits




Index: Builder.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/builder/Builder.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Builder.py	9 May 2006 06:04:48 -0000	1.5
+++ Builder.py	9 May 2006 19:10:51 -0000	1.6
@@ -447,6 +447,20 @@
         uploader.start()
         return uploader
 
+    def _handle_job_files_request(self, cmd):
+        """Return a list of urls of the result files of this job."""
+        archjob_id = cmd.archjob_id()
+        try:
+            job = self._all_jobs[archjob_id]
+        except KeyError:
+            return None
+
+        # url-ify the file list
+        urls = []
+        for fpath in job.files():
+            urls.append("file:///%s" % os.path.basename(fpath))
+        return Commands.PlgCommandJobFilesAck(archjob_id, urls, cmd.seq(), self._seq_gen.next())
+
     def _get_default_commands(self):
         """Return a python list of serialized commands that the builder
         sends to the server every time it contacts the server."""
@@ -505,6 +519,10 @@
             reply = self._handle_job_status_request(cmd)
             if reply:
                 self._queued_cmds.append(reply)
+        elif isinstance(cmd, Commands.PlgCommandJobFiles):
+            reply = self._handle_job_files_request(cmd)
+            if reply:
+                self._queued_cmds.append(reply)
 
     def _process_server_response(self, response):
         """Process the server's response command stream."""




More information about the fedora-extras-commits mailing list