extras-buildsys/server UserInterface.py,1.20,1.21 main.py,1.9,1.10
Daniel Williams (dcbw)
fedora-extras-commits at redhat.com
Wed Jul 20 14:51:56 UTC 2005
- Previous message (by thread): extras-buildsys/builder builder.py,1.21,1.22
- Next message (by thread): rpms/bash-completion/FC-4 .cvsignore, 1.7, 1.8 bash-completion.spec, 1.9, 1.10 sources, 1.7, 1.8 bash-completion-documents.patch, 1.1, NONE bash-completion-players.patch, 1.1, NONE bash-completion-tarballs.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: dcbw
Update of /cvs/fedora/extras-buildsys/server
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11592/server
Modified Files:
UserInterface.py main.py
Log Message:
2005-07-20 Dan Williams <dcbw at redhat.com>
* builder/builder.py
server/main.py
- Don't use lighttpd any more
- Fix some issues with non-SSL build systems (Oliver Falk)
* client/client.py
server/UserInterface.py
- Return job lists as dicts for easier use
- Return archjobs embedded in the job list rather than a separate array
Index: UserInterface.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/server/UserInterface.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- UserInterface.py 19 Jul 2005 02:29:48 -0000 1.20
+++ UserInterface.py 20 Jul 2005 14:51:53 -0000 1.21
@@ -151,42 +151,42 @@
def list_jobs(self, args_dict):
""" Query job information and return it to the user """
- sql = 'SELECT uid, username, package, cvs_tag, target, status FROM jobs WHERE '
+ sql = 'SELECT uid, username, package, cvs_tag, target, time_submitted, status FROM jobs WHERE '
sql_args = []
if args_dict.has_key('email') and args_dict['email']:
if validate_email(args_dict['email']):
sql_args.append('username LIKE "%%%s%%"' % args_dict['email'])
else:
- return (-1, "Error: Invalid email address.", [], [])
+ return (-1, "Error: Invalid email address.", [])
if args_dict.has_key('status') and args_dict['status']:
status = args_dict['status']
if PackageJob.is_package_job_stage_valid(status):
sql_args.append('status="%s"' % status)
else:
- return (-1, "Error: Invalid job status.", [], [])
+ return (-1, "Error: Invalid job status.", [])
if args_dict.has_key('uid') and args_dict['uid']:
uid = validate_uid(args_dict['uid'])
- if not uid:
- return (-1, "Error: Invalid job UID.", [], [])
+ if uid == None:
+ return (-1, "Error: Invalid job UID.", [])
sql_args.append('uid=%d' % uid)
if args_dict.has_key('uid_gt') and args_dict['uid_gt']:
uid = validate_uid(args_dict['uid_gt'])
- if not uid:
- return (-1, "Error: Invalid job UID.", [], [])
+ if uid == None:
+ return (-1, "Error: Invalid job UID.", [])
sql_args.append('uid>%d' % uid)
if args_dict.has_key('uid_lt') and args_dict['uid_lt']:
uid = validate_uid(args_dict['uid_lt'])
- if not uid:
- return (-1, "Error: Invalid job UID.", [], [])
+ if uid == None:
+ return (-1, "Error: Invalid job UID.", [])
sql_args.append('uid<%d' % uid)
if not len(sql_args):
- return (-1, "Error: Invalid query.", [], [])
+ return (-1, "Error: Invalid query.", [])
# Assemble the final SQL statement
i = 1
@@ -200,39 +200,56 @@
try:
dbcx, curs = get_dbcx()
except sqlite.DatabaseError, e:
- return (-1, "Unable to access job database.", [], [])
+ return (-1, "Unable to access job database.", [])
curs.execute(sql)
data = curs.fetchall()
- results = []
+ jobs = []
for row in data:
- tempX = [ item for item in row ]
- results.append(tempX)
- jobs = copy.deepcopy(results)
+ jobrec = {}
+ jobrec['uid'] = row[0]
+ jobrec['username'] = row[1]
+ jobrec['package'] = row[2]
+ jobrec['source'] = row[3]
+ jobrec['target'] = row[4]
+ jobrec['submit_time'] = row[5]
+ jobrec['status'] = row[6]
+ jobrec['archjobs'] = []
+ jobs.append(copy.deepcopy(jobrec))
+
+ print len(jobs)
# Mash all returned job UIDs into an SQL query to get all their archjobs
uids = ''
- for result in jobs:
+ for job in jobs:
if len(uids) == 0:
- uids = uids + "parent_uid=%d" % result[0]
+ uids = uids + "parent_uid=%d" % job['uid']
else:
- uids = uids + " OR parent_uid=%d" % result[0]
+ uids = uids + " OR parent_uid=%d" % job['uid']
# Get all archjobs for this job
- archjobs = []
if len(uids) > 0:
sql = "SELECT jobid, parent_uid, starttime, endtime, arch, builder_addr, status, builder_status FROM archjobs WHERE " + uids
curs.execute(sql)
data = curs.fetchall()
- aj_results = []
for row in data:
- tempX = [ item for item in row ]
- aj_results.append(tempX)
- archjobs = copy.deepcopy(aj_results)
+ ajrec = {}
+ ajrec['jobid'] = row[0]
+ ajrec['parent_uid'] = row[1]
+ ajrec['starttime'] = row[2]
+ ajrec['endtime'] = row[3]
+ ajrec['arch'] = row[4]
+ ajrec['builder_addr'] = row[5]
+ ajrec['status'] = row[6]
+ ajrec['builder_status'] = row[7]
+ for job in jobs:
+ if job['uid'] == ajrec['parent_uid']:
+ print "appending"
+ job['archjobs'].append(copy.deepcopy(ajrec))
del curs
del dbcx
- return (0, "Success.", jobs, archjobs)
+ return (0, "Success.", jobs)
def update_builders(self):
Index: main.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/server/main.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- main.py 12 Jul 2005 20:12:32 -0000 1.9
+++ main.py 20 Jul 2005 14:51:53 -0000 1.10
@@ -20,7 +20,6 @@
import os
import socket
from plague import AuthedXMLRPCServer
-from plague import lighttpdManager
from plague import HTTPServer
from plague import daemonize
import SimpleXMLRPCServer
@@ -38,8 +37,6 @@
# Load in the config
execfile("/etc/plague/server/CONFIG.py")
-use_lighttpd = False
-
class AuthenticatedSSLXMLRPCServer(AuthedXMLRPCServer.AuthedSSLXMLRPCServer):
"""
@@ -123,22 +120,12 @@
# SRPM fileserver
SRPM_SERVER_PORT = 8886
http_dir = os.path.join(config_opts['server_work_dir'], "srpm_http_dir")
- if use_lighttpd:
- http_cnf_file = "/var/tmp/plague-server.conf"
- if config_opts['ssl_builders']:
- key_and_cert = config_opts['server_key_and_cert']
- else:
- key_and_cert = None
- srpm_server = lighttpdManager.lighttpdManager(http_cnf_file, hostname, SRPM_SERVER_PORT, http_dir, False, key_and_cert)
- else:
- if config_opts['ssl_builders']:
- srpm_server_certs = {}
- srpm_server_certs['key_and_cert'] = config_opts['server_key_and_cert']
- srpm_server_certs['ca_cert'] = config_opts['ca_cert']
- srpm_server_certs['peer_ca_cert'] = config_opts['ca_cert']
- srpm_server = HTTPServer.PlgHTTPServerManager((hostname, SRPM_SERVER_PORT), http_dir, srpm_server_certs)
- else:
- srpm_server = HTTPServer.PlgHTTPServerManager((hostname, SRPM_SERVER_PORT), http_dir, None)
+ srpm_server_certs = {}
+ if config_opts['ssl_builders']:
+ srpm_server_certs['key_and_cert'] = config_opts['server_key_and_cert']
+ srpm_server_certs['ca_cert'] = config_opts['ca_cert']
+ srpm_server_certs['peer_ca_cert'] = config_opts['ca_cert']
+ srpm_server = HTTPServer.PlgHTTPServerManager((hostname, SRPM_SERVER_PORT), http_dir, srpm_server_certs)
srpm_server.start()
print "Build Server accepting requests on %s:%d.\n" % (hostname, UI_PORT)
- Previous message (by thread): extras-buildsys/builder builder.py,1.21,1.22
- Next message (by thread): rpms/bash-completion/FC-4 .cvsignore, 1.7, 1.8 bash-completion.spec, 1.9, 1.10 sources, 1.7, 1.8 bash-completion-documents.patch, 1.1, NONE bash-completion-players.patch, 1.1, NONE bash-completion-tarballs.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list