extras-buildsys/client client.py,1.20,1.21

Daniel Williams (dcbw) fedora-extras-commits at redhat.com
Tue Aug 2 04:10:34 UTC 2005


Author: dcbw

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

Modified Files:
	client.py 
Log Message:
2005-08-01  Dan Williams <dcbw at redhat.com>

    * Implement 'finished' state, allow users to move failed/needsign jobs
        to the 'finished' state

    * Random cleanups of database access code to make it more readable

    * Simplify user permissions

    * server/PackageJob.py
        - Each state/stage now has a private method called "_stage_<the-stage>"
            that gets called when the job is in that stage.  This simplifies
            the job's process routine quite a bit
        - Jobs now record a 'result', either 'success', 'failed', or 'killed'




Index: client.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/client/client.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- client.py	29 Jul 2005 07:16:05 -0000	1.20
+++ client.py	2 Aug 2005 04:10:32 -0000	1.21
@@ -100,7 +100,8 @@
 
 
 def validate_arg(arg):
-    if arg == 'email' or arg == 'status' or arg == 'uid' or arg == 'uid_gt' or arg == 'uid_lt':
+    args = ['email', 'status', 'result', 'uid', 'uid_gt', 'uid_lt']
+    if arg in args:
         return True
     return False
 
@@ -144,7 +145,7 @@
     else:
         for job in jobs:
             try:
-                print "%d: %s (%s)  %s   %s" % (job['uid'], job['package'], job['source'], job['username'], job['status'])    
+                print "%d: %s (%s)  %s   %s/%s" % (job['uid'], job['package'], job['source'], job['username'], job['status'], job['result'])    
                 for archjob in job['archjobs']:
                     print "\t%s(%s): %s %s/%s" % (archjob['builder_addr'], archjob['arch'], archjob['jobid'], archjob['status'], archjob['builder_status'])
                 print ''
@@ -249,6 +250,18 @@
         print "Error connecting to build server: '%s'" % e
 
 
+def finish(server, args):
+    uid_list = []
+    for uid in args:
+        uid_list.append(int(uid))
+
+    try:
+        (e, msg) = server.finish(uid_list)
+    except socket.error, e:
+        print "Error connecting to build server: '%s'" % e
+
+    print msg
+
 def getXMLRPCServerProxy(use_ssl):
     """
     Return an XMLRPC server proxy object, either one that uses SSL with certificates
@@ -365,6 +378,8 @@
         pause(server, False)
     elif cmd == 'is_paused':
         is_paused(server)
+    elif cmd == 'finish':
+        finish(server, sys.argv[2:])
     else:
         print "Unknown command."
         sys.exit(1)




More information about the scm-commits mailing list