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

extras-buildsys/client client.py,1.2,1.3



Author: dcbw

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

Modified Files:
	client.py 
Log Message:
2005-06-29  Dan Williams <dcbw redhat com>

    * Implement job kill functionality




Index: client.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/client/client.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- client.py	28 Jun 2005 16:46:12 -0000	1.2
+++ client.py	29 Jun 2005 05:22:55 -0000	1.3
@@ -107,6 +107,20 @@
         print job
 
 
+def kill(server, email, jobid):
+    """
+    Kill a job on the build server.
+    """
+
+    try:
+        (err, msg) = server.kill_job(email, jobid)
+    except (M2Crypto.SSL.SSLError, socket.error), e:
+        print "Error connecting to build server: '%s'" % e
+        return
+
+    print msg
+
+
 def print_clients(banner, client_list):
         print "\n%s:" % banner
         print "-" * 70
@@ -217,6 +231,7 @@
         print "      <command> is one of:"
         print "      build [package_name] [cvs_tag | srpm_path] [target]"
         print "      list"
+        print "      kill <jobid>"
         print "      update_clients"
         print "      list_clients"
 	print ""
@@ -248,6 +263,12 @@
             print e.message
     elif cmd == 'list':
         list_own_jobs(server, email)
+    elif cmd == 'kill':
+        if len(sys.argv) < 3:
+            print "Error: need a job UID to kill"
+            sys.exit(1)
+        jobid = sys.argv[2]
+        kill(server, email, jobid)
     elif cmd == 'update_clients':
         update_clients(server, email)
     elif cmd == 'list_clients':


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