extras-buildsys/common FileTransfer.py,1.2,1.3

Daniel Williams (dcbw) fedora-extras-commits at redhat.com
Tue May 9 06:04:56 UTC 2006


Author: dcbw

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

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

    * builder/Builder.py
        - (upload_files): fix extraction of server address, and pass
            the jobid to the server so it knows what the result files
            are for

    * builder/BuilderMock.py
        - Fix name of ul_callback()

    * common/FileTransfer.py
        - Trap operational errors

    * server/ArchJob.py
        - (get_upload_dir): new function; return the directory into
            which result files should be written

    * server/Builder.py
        - (get_archjob): new function; return archjob object for a
            particular jobid
        - (_handle_building_jobs): correct scoping of bits that get
            status for certain jobs
        - Increase the required active builder contact interval slightly
        - (request): reset the unavailable count every time the builder
            contacts us

    * server/BuilderManager.py
        - (__init__): Enable the HTTP POST handler when there are
            active builders
        - (upload_callback): handle incoming files by writing them
            to the correct location based on their jobid




Index: FileTransfer.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/common/FileTransfer.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FileTransfer.py	9 May 2006 02:53:03 -0000	1.2
+++ FileTransfer.py	9 May 2006 06:04:53 -0000	1.3
@@ -61,9 +61,13 @@
     def _process_one_transfer(self, data=None):
         """Retries a transfer for a specified number of times before failing."""
         status = FT_RESULT_FAILED
-        result = msg = None
+        result = msg = filed_msg = None
         for attempt in range(1, self._tries + 1):
-            (result, msg) = self._action(data)
+            try:
+                (result, msg) = self._action(data)
+            except ValueError, exc:
+                result = None
+                failed_msg = str(exc)
             if result:
                 status = FT_RESULT_SUCCESS
                 break
@@ -71,7 +75,9 @@
                 status = FT_RESULT_CANCELED
                 break
             time.sleep(5)
-            msg = "Transfer of timed out."
+            failed_msg = "Transfer timed out."
+        if status == FT_RESULT_FAILED:
+            msg = failed_msg
         return (status, msg)
 
     def run(self):




More information about the fedora-extras-commits mailing list