[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

extras-buildsys/server build-server, NONE, 1.1 buildjob.py, 1.3, 1.4 client_manager.py, 1.1, 1.2 FileDownloader.py, 1.1, NONE FileServer.py, 1.1, NONE



Author: dcbw

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

Modified Files:
	buildjob.py client_manager.py 
Added Files:
	build-server 
Removed Files:
	FileDownloader.py FileServer.py 
Log Message:
2005-06-08  Dan Williams <dcbw redhat com>

    * Refactor FileDownload.py and FileServer.py, moving them into a shared
      directory common/.  Fix client & server to point to these modules and
      implement callbacks in each that are required by FileDownload.py.  Since
      at this time we don't install anything to site-packages, the build-client
      and build-server scripts are necessary to properly set up PYTHONPATH to
      find stuff in the common/ directory.




--- NEW FILE build-server ---
#!/bin/bash

export PYTHONPATH="$PYTHONPATH:../common"
python buildserver.py


Index: buildjob.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/server/buildjob.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- buildjob.py	7 Jun 2005 12:10:23 -0000	1.3
+++ buildjob.py	8 Jun 2005 15:55:57 -0000	1.4
@@ -366,9 +366,7 @@
                     os.makedirs(dst_path)
                 shutil.copy(src_file, dst_path)
 
-        resultstring = """
-%s: Build of %s on %s succeeded.
-""" % (self.uid, self.name, self.target)
+        resultstring = "%s: Build of %s on %s succeeded." % (self.uid, self.name, self.target)
         self.email_result(resultstring)
 
         # Udpate the repo with new packages


Index: client_manager.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/server/client_manager.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- client_manager.py	7 Jun 2005 12:10:23 -0000	1.1
+++ client_manager.py	8 Jun 2005 15:55:57 -0000	1.2
@@ -98,7 +98,7 @@
                     target_dir = os.path.join(self.parent_job.get_stage_dir(), self.arch)
                     if not os.path.exists(target_dir):
                         os.makedirs(target_dir)
-                    dl_thread = FileDownloader.FileDownloader(self, url, target_dir)
+                    dl_thread = FileDownloader.FileDownloader(self.dl_callback, url, url, target_dir, ['.rpm', '.log'])
                     dl_thread.start()
                     undownloaded = True
                     self.downloads[url] = 1
@@ -115,6 +115,15 @@
             if not undownloaded:
                 self.status = 'done'
 
+    def dl_callback(self, status, cb_data):
+        url = cb_data
+        if status == 'done':
+            self.downloads[url] = 3
+            print("%s/%s: Finished downloading %s" % (self.jobid, self.arch, url))
+        elif status == 'failed':
+            self.downloads[url] = 2
+            print("%s/%s: Failed to download %s" % (self.jobid, self.arch, url))
+
     def get_status(self):
         return self.status
 
@@ -124,7 +133,7 @@
     def get_files(self):
         files = []
         for url in self.downloads.keys():
-            fname = FileDownloader.get_base_filename_from_url(url)
+            fname = FileDownloader.get_base_filename_from_url(url, ['.rpm', '.log'])
             if fname and self.downloads[url] == 3:
                 files.append(fname)
         return files


--- FileDownloader.py DELETED ---


--- FileServer.py DELETED ---


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]