---
builder/kojid | 140 +++++++++++++++++++++---------------------
cli/koji | 70 ++++++++++-----------
hub/kojihub.py | 28 ++++-----
hub/kojixmlrpc.py | 6 +-
koji/__init__.py | 4 +-
koji/auth.py | 10 +--
koji/context.py | 2 +-
koji/daemon.py | 2 +-
koji/db.py | 2 +-
koji/plugin.py | 2 +-
koji/policy.py | 3 +-
koji/server.py | 1 -
koji/ssl/SSLCommon.py | 1 -
koji/ssl/SSLConnection.py | 1 -
koji/ssl/XMLRPCServerProxy.py | 1 -
koji/tasks.py | 2 +-
koji/util.py | 2 +-
plugins/messagebus.py | 26 ++++----
plugins/runroot.py | 2 -
util/koji-gc | 1 -
util/koji-shadow | 1 -
util/kojira | 4 +-
vm/kojikamid.py | 6 +-
www/kojiweb/index.py | 98 ++++++++++++++---------------
www/lib/kojiweb/util.py | 15 +++--
25 files changed, 210 insertions(+), 220 deletions(-)
diff --git a/builder/kojid b/builder/kojid
index 3df0588..ae33e15 100755
--- a/builder/kojid
+++ b/builder/kojid
@@ -5,7 +5,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
@@ -1032,11 +1032,11 @@ class BaseBuildTask(BaseTaskHandler):
tag_arches = [koji.canonArch(a) for a in tag['arches'].split()]
host_arches = hostdata['arches'].split()
if not set(tag_arches).intersection(host_arches):
- self.logger.info('Task %s (%s): tag arches (%s) and ' \
- 'host arches (%s) are disjoint' % \
- (self.id, self.method,
- ', '.join(tag_arches), ',
'.join(host_arches)))
- return False
+ self.logger.info('Task %s (%s): tag arches (%s) and ' \
+ 'host arches (%s) are disjoint' % \
+ (self.id, self.method,
+ ', '.join(tag_arches), ',
'.join(host_arches)))
+ return False
#otherwise...
# This is in principle an error condition, but this is not a good
place
# to fail. Instead we proceed and let the task fail normally.
@@ -2389,7 +2389,7 @@ class ImageTask(BaseTaskHandler):
def fetchKickstart(self, broot, ksfile):
"""
- Retrieve the kickstart file we were given (locally or remotely) and
+ Retrieve the kickstart file we were given (locally or remotely) and
upload it.
Note that if the KS file existed locally, then "ksfile" is a relative
@@ -2488,7 +2488,7 @@ class ImageTask(BaseTaskHandler):
# Write out the new ks file. Note that things may not be in the same
# order and comments in the original ks file may be lost.
- kskoji = os.path.join('/tmp', 'koji-image-%s-%i.ks' %
+ kskoji = os.path.join('/tmp', 'koji-image-%s-%i.ks' %
(target_info['build_tag_name'], self.id))
kojikspath = os.path.join(broot.rootdir(), kskoji[1:])
outfile = open(kojikspath, 'w')
@@ -2503,7 +2503,7 @@ class ImageTask(BaseTaskHandler):
def getImagePackages(self, cachepath):
"""
- Read RPM header information from the yum cache available in the
+ Read RPM header information from the yum cache available in the
given path. Returns a list of dictionaries for each RPM included.
"""
found = False
@@ -2524,8 +2524,8 @@ class ImageTask(BaseTaskHandler):
raise koji.LiveCDError, 'No repos found in yum cache!'
return hdrlist
-# ApplianceTask begins with a mock chroot, and then installs appliance-tools
-# into it via the appliance-build group. appliance-creator is then executed
+# ApplianceTask begins with a mock chroot, and then installs appliance-tools
+# into it via the appliance-build group. appliance-creator is then executed
# in the chroot to create the appliance image.
#
class ApplianceTask(ImageTask):
@@ -2548,7 +2548,7 @@ class ApplianceTask(ImageTask):
if opts == None:
opts = {}
self.opts = opts
- broot = self.makeImgBuildRoot(build_tag, repo_info, arch,
+ broot = self.makeImgBuildRoot(build_tag, repo_info, arch,
'appliance-build')
kspath = self.fetchKickstart(broot, ksfile)
self.readKickstart(kspath, opts)
@@ -2561,11 +2561,11 @@ class ApplianceTask(ImageTask):
app_log = '/tmp/appliance.log'
os.mkdir(opath)
- cmd = ['/usr/bin/appliance-creator', '-c', kskoji, '-d', '-v',
+ cmd = ['/usr/bin/appliance-creator', '-c', kskoji, '-d', '-v',
'--logfile', app_log, '--cache', cachedir, '-o', odir]
for arg_name in ('vmem', 'vcpu', 'format'):
arg = opts.get(arg_name)
- if arg != None:
+ if arg != None:
cmd.extend(['--%s' % arg_name, arg])
appname = '%s-%s-%s' % (name, version, release)
cmd.extend(['--name', appname])
@@ -2582,7 +2582,7 @@ class ApplianceTask(ImageTask):
results = []
for directory, subdirs, files in os.walk(opath):
for f in files:
- results.append(os.path.join(broot.rootdir(), 'tmp',
+ results.append(os.path.join(broot.rootdir(), 'tmp',
directory, f))
self.logger.debug('output: %s' % results)
if len(results) == 0:
@@ -2610,7 +2610,7 @@ class ApplianceTask(ImageTask):
cachedir[1:]))
broot.markExternalRPMs(hdrlist)
imgdata['rpmlist'] = hdrlist
-
+
broot.expire()
return imgdata
@@ -2706,7 +2706,7 @@ class LiveCDTask(ImageTask):
livecd_log = '/tmp/livecd.log'
cmd = ['/usr/bin/livecd-creator', '-c', kskoji, '-d', '-v',
'--logfile', livecd_log, '--cache', cachedir]
- # we set the fs label to the same as the isoname if it exists,
+ # we set the fs label to the same as the isoname if it exists,
# taking at most 32 characters
isoname = '%s-%s-%s' % (name, version, release)
cmd.extend(['-f', isoname[:32]])
@@ -3398,7 +3398,7 @@ class BaseImageTask(OzImageTask):
class BuildIndirectionImageTask(OzImageTask):
Methods = ['indirectionimage']
- # So, these are copied directly from the base image class
+ # So, these are copied directly from the base image class
# Realistically, we want to inherit methods from both BuildImageTask
# and OzImageTask.
# TODO: refactor - my initial suggestion would be to have OzImageTask
@@ -3427,7 +3427,7 @@ class BuildIndirectionImageTask(OzImageTask):
def fetchHubOrSCM(self, filepath, fileurl):
"""
Retrieve a file either from the hub or a remote scm
-
+
If fileurl is None we assume we are being asked to retrieve from
the hub and that filepath is relative to /mnt/koji/work.
if fileurl contains a value we assume a remote SCM.
@@ -3466,7 +3466,7 @@ class BuildIndirectionImageTask(OzImageTask):
def _task_to_image(task_id):
""" Take a task ID and turn it into an Image Factory Base Image object
"""
pim = PersistentImageManager.default_manager()
- taskinfo = self.session.getTaskInfo(task_id)
+ taskinfo = self.session.getTaskInfo(task_id)
taskstate = koji.TASK_STATES[taskinfo['state']].lower()
if taskstate != 'closed':
raise koji.BuildError("Input task (%d) must be in closed state -
current state is (%s)" %
@@ -3475,21 +3475,21 @@ class BuildIndirectionImageTask(OzImageTask):
if taskmethod != "createImage":
raise koji.BuildError("Input task method must be 'createImage' -
actual method (%s)" %
(taskmethod))
- result = self.session.getTaskResult(task_id)
- files = self.session.listTaskOutput(task_id)
+ result = self.session.getTaskResult(task_id)
+ files = self.session.listTaskOutput(task_id)
# This approach works for both scratch and saved/formal images
# The downside is that we depend on the output file naming
convention
- def _match_name(inlist, namere):
- for filename in inlist:
- if re.search(namere, filename):
- return filename
- task_diskimage = _match_name(result['files'], ".*qcow2$")
- task_tdl = _match_name(result['files'], "tdl.*xml")
+ def _match_name(inlist, namere):
+ for filename in inlist:
+ if re.search(namere, filename):
+ return filename
+ task_diskimage = _match_name(result['files'], ".*qcow2$")
+ task_tdl = _match_name(result['files'], "tdl.*xml")
- task_dir =
os.path.join(koji.pathinfo.work(),koji.pathinfo.taskrelpath(task_id))
- diskimage_full = os.path.join(task_dir, task_diskimage)
- tdl_full = os.path.join(task_dir, task_tdl)
+ task_dir =
os.path.join(koji.pathinfo.work(),koji.pathinfo.taskrelpath(task_id))
+ diskimage_full = os.path.join(task_dir, task_diskimage)
+ tdl_full = os.path.join(task_dir, task_tdl)
if not (os.path.isfile(diskimage_full) and
os.path.isfile(tdl_full)):
raise koji.BuildError("Missing TDL or qcow2 image for task (%d) -
possible expired scratch build" % (task_id))
@@ -3508,7 +3508,7 @@ class BuildIndirectionImageTask(OzImageTask):
factory_base_image.status = 'COMPLETE'
# Now save it
pim.save_image(factory_base_image)
-
+
# We can now reference this object directly or via its UUID in
persistent storage
return factory_base_image
@@ -3518,10 +3518,10 @@ class BuildIndirectionImageTask(OzImageTask):
build = self.session.getBuild(nvr)
if not build:
raise koji.BuildError("Could not find build for (%s)" % (nvr))
-
+
buildarchives = self.session.listArchives(build['id'])
if not buildarchives:
- raise koji.Builderror("Could not retrieve archives for build (%s)
from NVR (%s)" %
+ raise koji.Builderror("Could not retrieve archives for build (%s)
from NVR (%s)" %
(build['id'], nvr))
buildfiles = [ x['filename'] for x in buildarchives ]
@@ -3539,7 +3539,7 @@ class BuildIndirectionImageTask(OzImageTask):
tdl_full = os.path.join(builddir, build_tdl)
if not (os.path.isfile(diskimage_full) and
os.path.isfile(tdl_full)):
- raise koji.BuildError("Missing TDL (%s) or qcow2 (%s) image for
image (%s) - this should never happen" %
+ raise koji.BuildError("Missing TDL (%s) or qcow2 (%s) image for
image (%s) - this should never happen" %
(build_tdl, build_diskimage, nvr))
# The sequence to recreate a valid persistent image is as follows
@@ -3588,12 +3588,12 @@ class BuildIndirectionImageTask(OzImageTask):
release = opts['release']
# TODO: Another mostly copy-paste
- if not release:
- release = self.getRelease(name, version)
- if '-' in version:
- raise koji.ApplianceError('The Version may not have a hyphen')
- if '-' in release:
- raise koji.ApplianceError('The Release may not have a hyphen')
+ if not release:
+ release = self.getRelease(name, version)
+ if '-' in version:
+ raise koji.ApplianceError('The Version may not have a hyphen')
+ if '-' in release:
+ raise koji.ApplianceError('The Release may not have a hyphen')
indirection_template =
self.fetchHubOrSCM(opts.get('indirection_template'),
opts.get('indirection_template_url'))
@@ -3601,24 +3601,24 @@ class BuildIndirectionImageTask(OzImageTask):
self.logger.debug('Got indirection template %s' %
(indirection_template))
try:
- if opts['utility_image_build']:
- utility_factory_image =
_nvr_to_image(opts['utility_image_build'], opts['arch'])
- else:
- utility_factory_image =
_task_to_image(int(opts['utility_image_task']))
-
- if opts['base_image_build']:
- base_factory_image = _nvr_to_image(opts['base_image_build'],
opts['arch'])
- else:
- base_factory_image =
_task_to_image(int(opts['base_image_task']))
+ if opts['utility_image_build']:
+ utility_factory_image =
_nvr_to_image(opts['utility_image_build'], opts['arch'])
+ else:
+ utility_factory_image =
_task_to_image(int(opts['utility_image_task']))
+
+ if opts['base_image_build']:
+ base_factory_image = _nvr_to_image(opts['base_image_build'],
opts['arch'])
+ else:
+ base_factory_image =
_task_to_image(int(opts['base_image_task']))
except Exception, e:
self.logger.exception(e)
raise
# OK - We have a template and two input images - lets build
- bld_info = None
- if not opts['scratch']:
- bld_info = self.initImageBuild(name, version, release,
- target_info, opts)
+ bld_info = None
+ if not opts['scratch']:
+ bld_info = self.initImageBuild(name, version, release,
+ target_info, opts)
try:
return self._do_indirection(opts, base_factory_image,
utility_factory_image,
@@ -3667,9 +3667,9 @@ class BuildIndirectionImageTask(OzImageTask):
open(target_image.data, "w").write("Mock build from task ID:
%s" %
(str(self.id)))
target_image.status='COMPLETE'
- else:
+ else:
target = bd.builder_for_target_image('indirection',
- image_id=base_factory_image.identifier,
+ image_id=base_factory_image.identifier,
parameters=params)
target.target_thread.join()
except Exception, e:
@@ -3697,7 +3697,7 @@ class BuildIndirectionImageTask(OzImageTask):
myresults['logs'] = [ os.path.basename(ozlog) ]
myresults['arch'] = opts['arch']
# TODO: This should instead track the two input images: base and
utility
- myresults['rpmlist'] = [ ]
+ myresults['rpmlist'] = [ ]
# This is compatible with some helper methods originally implemented
for the base
# image build. In the original usage, the dict contains an entry per
build arch
@@ -3825,7 +3825,7 @@ class BuildSRPMFromSCMTask(BaseBuildTask):
raise koji.BuildError, "Multiple srpms found in %s: %s" % (sourcedir,
", ".join(srpms))
else:
srpm = srpms[0]
-
+
# check srpm name
h = koji.get_rpm_header(srpm)
name = h[rpm.RPMTAG_NAME]
@@ -3844,7 +3844,7 @@ class BuildSRPMFromSCMTask(BaseBuildTask):
broot.expire()
return {'srpm': "%s/%s" % (uploadpath, srpm_name),
- 'logs': ["%s/%s" % (uploadpath, os.path.basename(f))
+ 'logs': ["%s/%s" % (uploadpath, os.path.basename(f))
for f in log_files],
'brootid': brootid,
}
@@ -3969,16 +3969,16 @@ Build Info: %(weburl)s/buildinfo?buildID=%(build_id)i\r
if not data:
data = {}
taskinfo = self.session.getTaskInfo(task_id)
-
+
if not taskinfo:
# invalid task_id
return data
-
+
if taskinfo['host_id']:
hostinfo = self.session.getHost(taskinfo['host_id'])
else:
hostinfo = None
-
+
result = None
try:
result = self.session.getTaskResult(task_id)
@@ -3994,17 +3994,17 @@ Build Info: %(weburl)s/buildinfo?buildID=%(build_id)i\r
sys.exc_clear()
if not result:
result = 'Unknown'
-
+
files = self.session.listTaskOutput(task_id)
logs = [filename for filename in files if filename.endswith('.log')]
rpms = [filename for filename in files if filename.endswith('.rpm')
and not filename.endswith('.src.rpm')]
srpms = [filename for filename in files if
filename.endswith('.src.rpm')]
misc = [filename for filename in files if filename not in logs + rpms
+ srpms]
-
+
logs.sort()
rpms.sort()
misc.sort()
-
+
data[task_id] = {}
data[task_id]['id'] = taskinfo['id']
data[task_id]['method'] = taskinfo['method']
@@ -4018,7 +4018,7 @@ Build Info: %(weburl)s/buildinfo?buildID=%(build_id)i\r
data[task_id]['rpms'] = rpms
data[task_id]['srpms'] = srpms
data[task_id]['misc'] = misc
-
+
children = self.session.getTaskChildren(task_id)
for child in children:
data = self._getTaskData(child['id'], data)
@@ -4057,7 +4057,7 @@ Build Info: %(weburl)s/buildinfo?buildID=%(build_id)i\r
elif build['state'] == koji.BUILD_STATES['FAILED']:
failure_data = task_data[task_id]['result']
failed_hosts = ['%s (%s)' % (task['host'], task['arch']) for task
in task_data.values() if task['host'] and task['state'] == 'failed']
- failure_info = "\r\n%s (%d) failed on %s:\r\n %s" % (build_nvr,
build_id,
+ failure_info = "\r\n%s (%d) failed on %s:\r\n %s" % (build_nvr,
build_id,
',
'.join(failed_hosts),
failure_data)
@@ -4066,14 +4066,14 @@ Build Info: %(weburl)s/buildinfo?buildID=%(build_id)i\r
tasks = {'failed' : [task for task in task_data.values() if
task['state'] == 'failed'],
'canceled' : [task for task in task_data.values() if
task['state'] == 'canceled'],
'closed' : [task for task in task_data.values() if
task['state'] == 'closed']}
-
+
srpms = []
for taskinfo in task_data.values():
for srpmfile in taskinfo['srpms']:
srpms.append(srpmfile)
srpms = self.uniq(srpms)
srpms.sort()
-
+
if srpms:
output = "SRPMS:\r\n"
for srpm in srpms:
@@ -4564,7 +4564,7 @@ if __name__ == "__main__":
except koji.AuthError, e:
quit("Error: Unable to log in: %s" % e)
except xmlrpclib.ProtocolError:
- quit("Error: Unable to connect to server %s" % (options.server))
+ quit("Error: Unable to connect to server %s" % (options.server))
elif options.user:
try:
# authenticate using user/password
diff --git a/cli/koji b/cli/koji
index bfb0955..839f7d6 100755
--- a/cli/koji
+++ b/cli/koji
@@ -6,7 +6,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
@@ -141,7 +141,7 @@ def get_options():
parser.add_option("--debug-xmlrpc", action="store_true", default=False,
help=_("show xmlrpc debug output"))
parser.add_option("-q", "--quiet", action="store_true", default=False,
- help=_("run quietly"))
+ help=_("run quietly"))
parser.add_option("--skip-main", action="store_true", default=False,
help=_("don't actually run main"))
parser.add_option("-s", "--server", help=_("url of XMLRPC server"))
@@ -205,7 +205,7 @@ def get_options():
'krbservice': 'host',
'cert': '~/.koji/client.crt',
'ca': '~/.koji/clientca.crt',
- 'serverca': '~/.koji/serverca.crt',
+ 'serverca': '~/.koji/serverca.crt',
'authtype': None
}
#note: later config files override earlier ones
@@ -263,7 +263,7 @@ def get_options():
# expand paths here, so we don't have to worry about it later
value = os.path.expanduser(getattr(options, name))
setattr(options, name, value)
-
+
#honor topdir
if options.topdir:
koji.BASEDIR = options.topdir
@@ -427,7 +427,7 @@ def display_task_results(tasks):
for task in [task for task in tasks.values() if task.level == 0]:
state = task.info['state']
task_label = task.str()
-
+
if state == koji.TASK_STATES['CLOSED']:
print '%s completed successfully' % task_label
elif state == koji.TASK_STATES['FAILED']:
@@ -526,7 +526,7 @@ def watch_logs(session, tasklist, opts):
while contents:
if not taskoffsets.has_key(log):
taskoffsets[log] = 0
-
+
contents = session.downloadTaskOutput(task_id, log,
taskoffsets[log], 16384)
taskoffsets[log] += len(contents)
if contents:
@@ -556,7 +556,7 @@ def handle_add_group(options, session, args):
assert False
tag = args[0]
group = args[1]
-
+
activate_session(session)
if not session.hasPerm('admin'):
print "This action requires admin privileges"
@@ -566,7 +566,7 @@ def handle_add_group(options, session, args):
if not dsttag:
print "Unknown tag: %s" % tag
return 1
-
+
groups = dict([(p['name'], p['group_id']) for p in
session.getTagGroups(tag, inherit=False)])
group_id = groups.get(group, None)
if group_id is not None:
@@ -574,7 +574,7 @@ def handle_add_group(options, session, args):
return 1
session.groupListAdd(tag, group)
-
+
def handle_add_host(options, session, args):
"[admin] Add a host"
usage = _("usage: %prog add-host [options] hostname arch [arch2 ...]")
@@ -694,7 +694,7 @@ def handle_remove_host_from_channel(options, session, args):
if channel not in hostchannels:
print "Host %s is not a member of channel %s" % (host, channel)
return 1
-
+
session.removeHostFromChannel(host, channel)
def handle_remove_channel(options, session, args):
@@ -903,7 +903,7 @@ def handle_build(options, session, args):
parser.error(_("Exactly two arguments (a build target and a SCM URL or
srpm file) are required"))
assert False
if build_opts.arch_override and not build_opts.scratch:
- parser.error(_("--arch_override is only allowed for --scratch
builds"))
+ parser.error(_("--arch_override is only allowed for --scratch builds"))
activate_session(session)
target = args[0]
if target.lower() == "none" and build_opts.repo_id:
@@ -987,7 +987,7 @@ def handle_chain_build(options, session, args):
return 1
sources = args[1:]
-
+
src_list = []
build_level = []
#src_lists is a list of lists of sources to build.
@@ -1017,7 +1017,7 @@ def handle_chain_build(options, session, args):
if build_opts.background:
#relative to koji.PRIO_DEFAULT
priority = 5
-
+
task_id = session.chainBuild(src_list, target, priority=priority)
print "Created task:", task_id
@@ -2534,7 +2534,7 @@ def anon_handle_latest_build(options, session, args):
print "%-40s %-20s %s" % ("Build","Tag","Built by")
print "%s %s %s" % ("-"*40, "-"*20, "-"*16)
options.quiet = True
-
+
output = [ fmt % x for x in data]
output.sort()
for line in output:
@@ -2927,7 +2927,7 @@ def anon_handle_list_hosts(options, session, args):
for host in hosts:
session.getLastHostUpdate(host['id'])
updateList = session.multiCall()
-
+
for host, [update] in zip(hosts, updateList):
if update is None:
host['update'] = '-'
@@ -3166,12 +3166,12 @@ def handle_clone_tag(options, session, args):
activate_session(session)
if not session.hasPerm('admin') and not options.test:
- print "This action requires admin privileges"
- return
+ print "This action requires admin privileges"
+ return
if args[0] == args[1]:
sys.stdout.write('Source and destination tags must be different.\n')
- return
+ return
# store tags.
srctag = session.getTag(args[0])
dsttag = session.getTag(args[1])
@@ -3433,7 +3433,7 @@ def handle_add_target(options, session, args):
if not session.hasPerm('admin'):
print "This action requires admin privileges"
return 1
-
+
chkbuildtag = session.getTag(build_tag)
chkdesttag = session.getTag(dest_tag)
if not chkbuildtag:
@@ -3445,7 +3445,7 @@ def handle_add_target(options, session, args):
if not chkdesttag:
print "Destination tag does not exist: %s" % dest_tag
return 1
-
+
session.createBuildTarget(name, build_tag, dest_tag)
def handle_edit_target(options, session, args):
@@ -3509,13 +3509,13 @@ def handle_remove_target(options, session, args):
if not session.hasPerm('admin'):
print "This action requires admin privileges"
return
-
+
target = args[0]
target_info = session.getBuildTarget(target)
if not target_info:
print "Build target %s does not exist" % target
return 1
-
+
session.deleteBuildTarget(target_info['id'])
def handle_remove_tag(options, session, args):
@@ -4680,7 +4680,7 @@ def handle_edit_tag_inheritance(options, session, args):
return 1
print _("Error: Key constraints may be broken. Exiting.")
return 1
-
+
# len(data) == 1
data = data[0]
@@ -5101,7 +5101,7 @@ def handle_image_build_indirection(options, session,
args):
usage += _("\n %prog image-build --config FILE")
usage += _("\n\n(Specify the --help global option for a list of other " +
"help options)")
- parser = OptionParser(usage=usage)
+ parser = OptionParser(usage=usage)
parser.add_option("--config",
help=_("Use a configuration file to define image-build options " +
"instead of command line options (they will be ignored)."))
@@ -5151,19 +5151,19 @@ def _build_image_indirection(options, task_opts,
session, args):
"""
# Do some sanity checks before even attempting to create the session
- if not (bool(task_opts.utility_image_task) !=
+ if not (bool(task_opts.utility_image_task) !=
bool(task_opts.utility_image_build)):
raise koji.GenericError, _("You must specify either a utility-image task
or build ID/NVR")
- if not (bool(task_opts.base_image_task) !=
+ if not (bool(task_opts.base_image_task) !=
bool(task_opts.base_image_build)):
raise koji.GenericError, _("You must specify either a base-image task or
build ID/NVR")
required_opts = [ 'name', 'version', 'arch', 'target',
'indirection_template', 'results_loc' ]
optional_opts = [ 'indirection_template_url', 'scratch',
'utility_image_task', 'utility_image_build',
- 'base_image_task', 'base_image_build', 'release',
'skip_tag' ]
+ 'base_image_task', 'base_image_build', 'release',
'skip_tag' ]
- missing = [ ]
+ missing = [ ]
for opt in required_opts:
if not getattr(task_opts, opt, None):
missing.append(opt)
@@ -5909,7 +5909,7 @@ def handle_move_build(opts, session, args):
activate_session(session)
tasks = []
builds = []
-
+
if options.all:
for arg in args[2:]:
pkg = session.getPackage(arg)
@@ -5923,10 +5923,10 @@ def handle_move_build(opts, session, args):
build = session.getBuild(arg)
if not build:
print _("Invalid build %s, skipping." % arg)
- continue
+ continue
if not build in builds:
builds.append(build)
-
+
for build in builds:
task_id = session.moveBuild(args[0], args[1], build['id'],
options.force)
tasks.append(task_id)
@@ -6045,7 +6045,7 @@ def anon_handle_download_build(options, session, args):
elif len(args) > 1:
parser.error(_("Only a single package N-V-R or build ID may be
specified"))
assert False
-
+
activate_session(session)
build = args[0]
@@ -6060,7 +6060,7 @@ def anon_handle_download_build(options, session, args):
print "No associated builds for task %s" % build
return 1
build = builds[0]['build_id']
-
+
if suboptions.latestfrom:
# We want the latest build, not a specific build
try:
@@ -6074,7 +6074,7 @@ def anon_handle_download_build(options, session, args):
info = builds[0]
else:
info = session.getBuild(build)
-
+
if info is None:
print "No such build: %s" % build
return 1
@@ -6134,7 +6134,7 @@ def anon_handle_download_build(options, session, args):
pg = None
else:
pg = progress.TextMeter()
-
+
for url, relpath in urls:
file = grabber.urlopen(url, progress_obj=pg, text=relpath)
diff --git a/hub/kojihub.py b/hub/kojihub.py
index 9decf7c..3cb9648 100644
--- a/hub/kojihub.py
+++ b/hub/kojihub.py
@@ -5,7 +5,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
@@ -3442,8 +3442,8 @@ def list_rpms(buildID=None, buildrootID=None,
imageID=None, componentBuildrootID
# image specific constraints
if imageID != None:
- clauses.append('image_listing.image_id = %(imageID)i')
- joins.append('image_listing ON rpminfo.id = image_listing.rpm_id')
+ clauses.append('image_listing.image_id = %(imageID)i')
+ joins.append('image_listing ON rpminfo.id = image_listing.rpm_id')
if hostID != None:
joins.append('buildroot ON rpminfo.buildroot_id = buildroot.id')
@@ -3553,7 +3553,7 @@ def list_archives(buildID=None, buildrootID=None,
componentBuildrootID=None, hos
checksum_type: the checksum type (integer)
If componentBuildrootID is specified, then the map will also contain the
following key:
- project: whether the archive was pulled in as a project dependency, or as
part of the
+ project: whether the archive was pulled in as a project dependency, or as
part of the
build environment setup (boolean)
If 'type' is specified, then the archives listed will be limited
@@ -3590,7 +3590,7 @@ def list_archives(buildID=None, buildrootID=None,
componentBuildrootID=None, hos
an empty list is returned.
"""
values = {}
-
+
tables = ['archiveinfo']
joins = ['archivetypes on archiveinfo.type_id = archivetypes.id']
fields = [('archiveinfo.id', 'id'),
@@ -5949,7 +5949,7 @@ def get_notification_recipients(build, tag_id, state):
for this tag and the user who submitted the build. The list will not
contain
duplicates.
"""
-
+
clauses = []
if build:
@@ -7542,7 +7542,7 @@ class RootExports(object):
"""
Import an archive file and associate it with a build. The archive can
be any non-rpm filetype supported by Koji.
-
+
filepath: path to the archive file (relative to the Koji workdir)
buildinfo: information about the build to associate the archive with
May be a string (NVR), integer (buildID), or dict
(containing keys: name, version, release)
@@ -8557,7 +8557,7 @@ class RootExports(object):
raise koji.GenericError, 'user already exists: %s' % username
if krb_principal and get_user(krb_principal):
raise koji.GenericError, 'user with this Kerberos principal
already exists: %s' % krb_principal
-
+
return context.session.createUser(username, status=status,
krb_principal=krb_principal)
def enableUser(self, username):
@@ -8566,14 +8566,14 @@ class RootExports(object):
if not user:
raise koji.GenericError, 'unknown user: %s' % username
set_user_status(user, koji.USER_STATUS['NORMAL'])
-
+
def disableUser(self, username):
"""Disable logins by the specified user"""
user = get_user(username)
if not user:
raise koji.GenericError, 'unknown user: %s' % username
set_user_status(user, koji.USER_STATUS['BLOCKED'])
-
+
#group management calls
newGroup = staticmethod(new_group)
addGroupMember = staticmethod(add_group_member)
@@ -9223,11 +9223,11 @@ class RootExports(object):
notificationUser = self.getUser(user_id)
if not notificationUser:
raise koji.GenericError, 'invalid user ID: %s' % user_id
-
+
if not (notificationUser['id'] == currentUser['id'] or
self.hasPerm('admin')):
raise koji.GenericError, 'user %s cannot create notifications for
user %s' % \
(currentUser['name'], notificationUser['name'])
-
+
email = '%s@%s' % (notificationUser['name'],
context.opts['EmailDomain'])
insert = """INSERT INTO build_notifications
(user_id, package_id, tag_id, success_only, email)
@@ -10076,7 +10076,7 @@ class HostExports(object):
if len(poms) == 0:
pass
elif len(poms) == 1:
- # This directory has a .pom file, so get the Maven group_id,
+ # This directory has a .pom file, so get the Maven group_id,
# artifact_id, and version from it and associate those with
# the artifacts in this directory
pom_path = os.path.join(maven_task_dir, relpath, poms[0])
@@ -10317,7 +10317,7 @@ class HostExports(object):
def importImage(self, task_id, build_id, results):
"""
- Import a built image, populating the database with metadata and
+ Import a built image, populating the database with metadata and
moving the image to its final location.
"""
for sub_results in results.values():
diff --git a/hub/kojixmlrpc.py b/hub/kojixmlrpc.py
index 67cb8ee..0e51012 100644
--- a/hub/kojixmlrpc.py
+++ b/hub/kojixmlrpc.py
@@ -3,7 +3,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
@@ -292,7 +292,7 @@ class ModXMLRPCRequestHandler(object):
if context.opts.get('LockOut') and \
context.method not in ('login', 'krbLogin', 'sslLogin', 'logout')
and \
not context.session.hasPerm('admin'):
- raise koji.ServerOffline, "Server disabled for maintenance"
+ raise koji.ServerOffline, "Server disabled for maintenance"
def _dispatch(self, method, params):
func = self._get_handler(method)
@@ -569,7 +569,7 @@ def get_policy(opts, plugins):
if pname != test.policy:
continue
elif pname not in test.policy:
- continue
+ continue
# in case of name overlap, last one wins
# hence plugins can override builtin tests
merged[name] = test
diff --git a/koji/__init__.py b/koji/__init__.py
index d133ed1..24f0808 100644
--- a/koji/__init__.py
+++ b/koji/__init__.py
@@ -5,7 +5,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
@@ -987,7 +987,7 @@ def parse_pom(path=None, contents=None):
raise GenericError, 'either a path to a pom file or the contents of a
pom file must be specified'
# A common problem is non-UTF8 characters in XML files, so we'll convert
the string first
-
+
contents = fixEncoding(contents)
try:
diff --git a/koji/auth.py b/koji/auth.py
index 8e51ec7..d419d77 100644
--- a/koji/auth.py
+++ b/koji/auth.py
@@ -3,7 +3,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
@@ -247,7 +247,7 @@ class Session(object):
if not result:
raise koji.AuthError, 'invalid user_id: %s' % user_id
name, usertype, status = result
-
+
if status != koji.USER_STATUS['NORMAL']:
raise koji.AuthError, 'logins by %s are not allowed' % name
@@ -394,7 +394,7 @@ class Session(object):
raise koji.AuthError, '%s is not authorized to login other
users' % client_dn
else:
username = client_name
-
+
cursor = context.cnx.cursor()
query = """SELECT id FROM users
WHERE name = %(username)s"""
@@ -596,7 +596,7 @@ class Session(object):
"""
if not name:
raise koji.GenericError, 'a user must have a non-empty name'
-
+
if usertype == None:
usertype = koji.USERTYPES['NORMAL']
elif not koji.USERTYPES.get(usertype):
@@ -606,7 +606,7 @@ class Session(object):
status = koji.USER_STATUS['NORMAL']
elif not koji.USER_STATUS.get(status):
raise koji.GenericError, 'invalid status: %s' % status
-
+
cursor = context.cnx.cursor()
select = """SELECT nextval('users_id_seq')"""
cursor.execute(select, locals())
diff --git a/koji/context.py b/koji/context.py
index f904bed..b05e3a3 100755
--- a/koji/context.py
+++ b/koji/context.py
@@ -3,7 +3,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
diff --git a/koji/daemon.py b/koji/daemon.py
index b9f3070..d76355b 100644
--- a/koji/daemon.py
+++ b/koji/daemon.py
@@ -4,7 +4,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
diff --git a/koji/db.py b/koji/db.py
index f5f6104..dcd2461 100644
--- a/koji/db.py
+++ b/koji/db.py
@@ -5,7 +5,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
diff --git a/koji/plugin.py b/koji/plugin.py
index e189d1f..cbb245e 100644
--- a/koji/plugin.py
+++ b/koji/plugin.py
@@ -3,7 +3,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
diff --git a/koji/policy.py b/koji/policy.py
index 47e7237..653f414 100644
--- a/koji/policy.py
+++ b/koji/policy.py
@@ -2,7 +2,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
@@ -368,4 +368,3 @@ def findSimpleTests(namespace):
ret.setdefault(name, value)
#...so first test wins in case of name overlap
return ret
-
diff --git a/koji/server.py b/koji/server.py
index 7d9ed3e..7cc8be8 100644
--- a/koji/server.py
+++ b/koji/server.py
@@ -187,4 +187,3 @@ class InputWrapper(object):
while line:
yield line
line = self.readline()
-
diff --git a/koji/ssl/SSLCommon.py b/koji/ssl/SSLCommon.py
index 5cb722d..0d3fb94 100644
--- a/koji/ssl/SSLCommon.py
+++ b/koji/ssl/SSLCommon.py
@@ -139,4 +139,3 @@ class PlgHTTPS(httplib.HTTP):
def __init__(self, host='', port=None, ssl_context=None, strict=None,
timeout=None):
self._setup(self._connection_class(host, port, ssl_context, strict,
timeout))
-
diff --git a/koji/ssl/SSLConnection.py b/koji/ssl/SSLConnection.py
index 1bb9e76..5a45095 100644
--- a/koji/ssl/SSLConnection.py
+++ b/koji/ssl/SSLConnection.py
@@ -156,4 +156,3 @@ class PlgFileObject(socket._fileobject):
self._sock.close()
finally:
self._sock = None
-
diff --git a/koji/ssl/XMLRPCServerProxy.py b/koji/ssl/XMLRPCServerProxy.py
index 40b174d..16de619 100644
--- a/koji/ssl/XMLRPCServerProxy.py
+++ b/koji/ssl/XMLRPCServerProxy.py
@@ -176,4 +176,3 @@ if __name__ == '__main__':
except KeyboardInterrupt:
os._exit(0)
print "All done. (%d timed out)" % tm.get()
-
diff --git a/koji/tasks.py b/koji/tasks.py
index 46a7099..0d9a003 100644
--- a/koji/tasks.py
+++ b/koji/tasks.py
@@ -4,7 +4,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
diff --git a/koji/util.py b/koji/util.py
index e7c95a7..80e511f 100644
--- a/koji/util.py
+++ b/koji/util.py
@@ -2,7 +2,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
diff --git a/plugins/messagebus.py b/plugins/messagebus.py
index a23bc94..4ebf806 100644
--- a/plugins/messagebus.py
+++ b/plugins/messagebus.py
@@ -22,19 +22,19 @@ session = None
target = None
def connect_timeout(host, port, timeout):
- for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
- af, socktype, proto, canonname, sa = res
- sock = socket.socket(af, socktype, proto)
- sock.settimeout(timeout)
- try:
- sock.connect(sa)
- break
- except socket.error, msg:
- sock.close()
- else:
- # If we got here then we couldn't connect (yet)
- raise
- return sock
+ for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
+ af, socktype, proto, canonname, sa = res
+ sock = socket.socket(af, socktype, proto)
+ sock.settimeout(timeout)
+ try:
+ sock.connect(sa)
+ break
+ except socket.error, msg:
+ sock.close()
+ else:
+ # If we got here then we couldn't connect (yet)
+ raise
+ return sock
class tlstimeout(qpid.messaging.transports.tls):
def __init__(self, conn, host, port):
diff --git a/plugins/runroot.py b/plugins/runroot.py
index 427d483..86b6892 100644
--- a/plugins/runroot.py
+++ b/plugins/runroot.py
@@ -319,5 +319,3 @@ class RunRootTask(tasks.BaseTaskHandler):
os.unlink(fn)
except OSError:
pass
-
-
diff --git a/util/koji-gc b/util/koji-gc
index 871c7f8..2d61aa4 100755
--- a/util/koji-gc
+++ b/util/koji-gc
@@ -957,4 +957,3 @@ if __name__ == "__main__":
pass
if not options.skip_main:
sys.exit(rv)
-
diff --git a/util/koji-shadow b/util/koji-shadow
index cdeef8c..3b62776 100755
--- a/util/koji-shadow
+++ b/util/koji-shadow
@@ -1328,4 +1328,3 @@ if __name__ == "__main__":
except:
pass
sys.exit(rv)
-
diff --git a/util/kojira b/util/kojira
index fe827be..c18f63b 100755
--- a/util/kojira
+++ b/util/kojira
@@ -5,7 +5,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
@@ -130,7 +130,7 @@ class ManagedRepo(object):
if not tag_info:
tag_info = getTag(self.session, self.tag_id, self.event_id)
if not tag_info:
- self.logger.warn('Could not get info for tag %i, skipping delete
of repo %i' %
+ self.logger.warn('Could not get info for tag %i, skipping delete
of repo %i' %
(self.tag_id, self.repo_id))
return False
tag_name = tag_info['name']
diff --git a/vm/kojikamid.py b/vm/kojikamid.py
index c142267..15c0570 100755
--- a/vm/kojikamid.py
+++ b/vm/kojikamid.py
@@ -6,7 +6,7 @@
#
# Koji is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
+# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This software is distributed in the hope that it will be useful,
@@ -276,7 +276,7 @@ class WindowsBuild(object):
continue
tokens = entry.split(':')
filename = tokens[0]
- for var in ('name', 'version', 'release'):
+ for var in ('name', 'version', 'release'):
filename = filename.replace('$' + var, getattr(self, var))
metadata = {}
metadata['platforms'] = tokens[1].split(',')
@@ -589,7 +589,7 @@ def get_mgmt_server():
macaddr, gateway, MANAGER_PORT)
server = xmlrpclib.ServerProxy('http://%s:%s/' %
(gateway, MANAGER_PORT), allow_none=True)
- # we would set a timeout on the socket here, but that is apparently not
+ # we would set a timeout on the socket here, but that is apparently not
# supported by python/cygwin/Windows
task_port = server.getPort(macaddr)
logger.debug('found task-specific port %s', task_port)
diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py
index ff15a5f..4be6131 100644
--- a/www/kojiweb/index.py
+++ b/www/kojiweb/index.py
@@ -286,7 +286,7 @@ def index(environ, packageOrder='package_name',
packageStart=None):
if user:
packages = kojiweb.util.paginateResults(server, values,
'listPackages', kw={'userID': user['id'], 'with_dups': True},
start=packageStart,
dataName='packages', prefix='package', order=packageOrder, pageSize=10)
-
+
notifs = server.getBuildNotifications(user['id'])
notifs.sort(kojiweb.util.sortByKeyFunc('id'))
# XXX Make this a multicall
@@ -294,21 +294,21 @@ def index(environ, packageOrder='package_name',
packageStart=None):
notif['package'] = None
if notif['package_id']:
notif['package'] = server.getPackage(notif['package_id'])
-
+
notif['tag'] = None
if notif['tag_id']:
notif['tag'] = server.getTag(notif['tag_id'])
values['notifs'] = notifs
-
+
values['user'] = user
values['welcomeMessage'] = environ['koji.options']['KojiGreeting']
-
+
return _genHTML(environ, 'index.chtml')
def notificationedit(environ, notificationID):
server = _getServer(environ)
_assertLogin(environ)
-
+
notificationID = int(notificationID)
notification = server.getBuildNotification(notificationID)
if notification == None:
@@ -399,7 +399,7 @@ def notificationcreate(environ):
def notificationdelete(environ, notificationID):
server = _getServer(environ)
_assertLogin(environ)
-
+
notificationID = int(notificationID)
notification = server.getBuildNotification(notificationID)
if not notification:
@@ -491,7 +491,7 @@ def tasks(environ, owner=None, state='active', view='tree',
method='all', hostID
if view in ('tree', 'toplevel'):
opts['parent'] = None
-
+
if state == 'active':
opts['state'] = [koji.TASK_STATES['FREE'], koji.TASK_STATES['OPEN'],
koji.TASK_STATES['ASSIGNED']]
elif state == 'all':
@@ -531,7 +531,7 @@ def tasks(environ, owner=None, state='active', view='tree',
method='all', hostID
tasks = kojiweb.util.paginateMethod(server, values, 'listTasks',
kw={'opts': opts},
start=start, dataName='tasks',
prefix='task', order=order)
-
+
if view == 'tree':
server.multicall = True
for task in tasks:
@@ -577,7 +577,7 @@ def taskinfo(environ, taskID):
values['parent'] = parent
else:
values['parent'] = None
-
+
descendents = server.getTaskDescendents(task['id'], request=True)
values['descendents'] = descendents
@@ -641,7 +641,7 @@ def taskinfo(environ, taskID):
values['wrapTask'] = wrapTask
elif task['method'] == 'restartVerify':
values['rtask'] = server.getTaskInfo(params[0], request=True)
-
+
if task['state'] in (koji.TASK_STATES['CLOSED'],
koji.TASK_STATES['FAILED']):
try:
result = server.getTaskResult(task['id'])
@@ -688,7 +688,7 @@ def taskstatus(environ, taskID):
def resubmittask(environ, taskID):
server = _getServer(environ)
_assertLogin(environ)
-
+
taskID = int(taskID)
newTaskID = server.resubmitTask(taskID)
_redirect(environ, 'taskinfo?taskID=%i' % newTaskID)
@@ -817,13 +817,13 @@ def packages(environ, tagID=None, userID=None,
order='package_name', start=None,
values['prefix'] = prefix
inherited = int(inherited)
values['inherited'] = inherited
-
+
packages = kojiweb.util.paginateResults(server, values, 'listPackages',
kw={'tagID': tagID, 'userID':
userID, 'prefix': prefix, 'inherited': bool(inherited)},
start=start, dataName='packages',
prefix='package', order=order)
-
+
values['chars'] = _PREFIX_CHARS
-
+
return _genHTML(environ, 'packages.chtml')
def packageinfo(environ, packageID, tagOrder='name', tagStart=None,
buildOrder='-completion_time', buildStart=None):
@@ -840,7 +840,7 @@ def packageinfo(environ, packageID, tagOrder='name',
tagStart=None, buildOrder='
values['package'] = package
values['packageID'] = package['id']
-
+
tags = kojiweb.util.paginateMethod(server, values, 'listTags',
kw={'package': package['id']},
start=tagStart, dataName='tags',
prefix='tag', order=tagOrder)
builds = kojiweb.util.paginateMethod(server, values, 'listBuilds',
kw={'packageID': package['id']},
@@ -966,7 +966,7 @@ def tagedit(environ, tagID):
params['maven_include_all'] =
bool(form.has_key('maven_include_all'))
server.editTag2(tag['id'], **params)
-
+
_redirect(environ, 'taginfo?tagID=%i' % tag['id'])
elif form.has_key('cancel'):
_redirect(environ, 'taginfo?tagID=%i' % tag['id'])
@@ -1016,7 +1016,7 @@ def tagparent(environ, tagID, parentID, action):
data = server.getInheritanceData(tag['id'])
data.append(newDatum)
-
+
server.setInheritanceData(tag['id'], data)
elif form.has_key('cancel'):
pass
@@ -1039,7 +1039,7 @@ def tagparent(environ, tagID, parentID, action):
values['inheritanceData'] = inheritanceData[0]
else:
raise koji.GenericError, 'tag %i has tag %i listed as a
parent more than once' % (tag['id'], parent['id'])
-
+
return _genHTML(environ, 'tagparent.chtml')
elif action == 'remove':
data = server.getInheritanceData(tag['id'])
@@ -1076,7 +1076,7 @@ def buildinfo(environ, buildID):
server = _getServer(environ)
buildID = int(buildID)
-
+
build = server.getBuild(buildID)
values['title'] = koji.buildLabel(build) + ' | Build Info'
@@ -1170,7 +1170,7 @@ def buildinfo(environ, buildID):
values['imagebuild'] = imagebuild
values['archives'] = archives
values['archivesByExt'] = archivesByExt
-
+
values['noarch_log_dest'] = noarch_log_dest
if environ['koji.currentUser']:
values['perms'] =
server.getUserPerms(environ['koji.currentUser']['id'])
@@ -1243,7 +1243,7 @@ def builds(environ, userID=None, tagID=None,
packageID=None, state=None, order='
if prefix not in _PREFIX_CHARS:
prefix = None
values['prefix'] = prefix
-
+
values['order'] = order
if type in ('maven', 'win', 'image'):
pass
@@ -1274,7 +1274,7 @@ def builds(environ, userID=None, tagID=None,
packageID=None, state=None, order='
'type': type,
'state': state, 'prefix': prefix},
start=start, dataName='builds',
prefix='build', order=order)
-
+
values['chars'] = _PREFIX_CHARS
return _genHTML(environ, 'builds.chtml')
@@ -1295,7 +1295,7 @@ def users(environ, order='name', start=None, prefix=None):
start=start, dataName='users',
prefix='user', order=order)
values['chars'] = _PREFIX_CHARS
-
+
return _genHTML(environ, 'users.chtml')
def userinfo(environ, userID, packageOrder='package_name', packageStart=None,
buildOrder='-completion_time', buildStart=None):
@@ -1314,10 +1314,10 @@ def userinfo(environ, userID,
packageOrder='package_name', packageStart=None, bu
packages = kojiweb.util.paginateResults(server, values, 'listPackages',
kw={'userID': user['id'], 'with_dups': True},
start=packageStart,
dataName='packages', prefix='package', order=packageOrder, pageSize=10)
-
+
builds = kojiweb.util.paginateMethod(server, values, 'listBuilds',
kw={'userID': user['id']},
start=buildStart, dataName='builds',
prefix='build', order=buildOrder, pageSize=10)
-
+
return _genHTML(environ, 'userinfo.chtml')
def rpminfo(environ, rpmID, fileOrder='name', fileStart=None,
buildrootOrder='-id', buildrootStart=None):
@@ -1360,7 +1360,7 @@ def rpminfo(environ, rpmID, fileOrder='name',
fileStart=None, buildrootOrder='-i
values['build'] = build
values['builtInRoot'] = builtInRoot
values['buildroots'] = buildroots
-
+
files = kojiweb.util.paginateMethod(server, values, 'listRPMFiles',
args=[rpm['id']],
start=fileStart, dataName='files',
prefix='file', order=fileOrder)
@@ -1408,7 +1408,7 @@ def fileinfo(environ, filename, rpmID=None,
archiveID=None):
values['rpm'] = None
values['archive'] = None
-
+
if rpmID:
rpmID = int(rpmID)
rpm = server.getRPM(rpmID)
@@ -1439,7 +1439,7 @@ def fileinfo(environ, filename, rpmID=None,
archiveID=None):
def cancelbuild(environ, buildID):
server = _getServer(environ)
_assertLogin(environ)
-
+
buildID = int(buildID)
build = server.getBuild(buildID)
if build == None:
@@ -1468,7 +1468,7 @@ def hosts(environ, state='enabled', start=None,
order='name'):
values['state'] = state
hosts = server.listHosts(**args)
-
+
server.multicall = True
for host in hosts:
server.getLastHostUpdate(host['id'])
@@ -1518,7 +1518,7 @@ def hostinfo(environ, hostID=None, userID=None):
values['perms'] =
server.getUserPerms(environ['koji.currentUser']['id'])
else:
values['perms'] = []
-
+
return _genHTML(environ, 'hostinfo.chtml')
def hostedit(environ, hostID):
@@ -1630,7 +1630,7 @@ def buildrootinfo(environ, buildrootID, builtStart=None,
builtOrder=None, compon
values['buildroot'] = buildroot
values['task'] = task
-
+
return _genHTML(environ, 'buildrootinfo.chtml')
def rpmlist(environ, type, buildrootID=None, imageID=None, start=None,
order='nvr'):
@@ -1714,13 +1714,13 @@ def buildtargets(environ, start=None, order='name'):
targets = kojiweb.util.paginateMethod(server, values, 'getBuildTargets',
start=start, dataName='targets',
prefix='target', order=order)
-
+
values['order'] = order
if environ['koji.currentUser']:
values['perms'] =
server.getUserPerms(environ['koji.currentUser']['id'])
else:
values['perms'] = []
-
+
return _genHTML(environ, 'buildtargets.chtml')
def buildtargetinfo(environ, targetID=None, name=None):
@@ -1733,7 +1733,7 @@ def buildtargetinfo(environ, targetID=None, name=None):
target = server.getBuildTarget(targetID)
elif name != None:
target = server.getBuildTarget(name)
-
+
if target == None:
raise koji.GenericError, 'invalid build target: %s' % (targetID or
name)
@@ -1785,7 +1785,7 @@ def buildtargetedit(environ, targetID):
values = _initValues(environ, 'Edit Build Target', 'buildtargets')
tags = server.listTags()
tags.sort(_sortbyname)
-
+
values['target'] = target
values['tags'] = tags
@@ -1810,7 +1810,7 @@ def buildtargetcreate(environ):
if target == None:
raise koji.GenericError, 'error creating build target "%s"' % name
-
+
_redirect(environ, 'buildtargetinfo?targetID=%i' % target['id'])
elif form.has_key('cancel'):
_redirect(environ, 'buildtargets')
@@ -1860,7 +1860,7 @@ def buildsbyuser(environ, start=None, order='-builds'):
user['builds'] = numBuilds
if numBuilds > maxBuilds:
maxBuilds = numBuilds
-
+
values['order'] = order
graphWidth = 400.0
@@ -1893,14 +1893,14 @@ def rpmsbyhost(environ, start=None, order=None,
hostArch=None, rpmArch=None):
host['rpms'] = numRPMs
if numRPMs > maxRPMs:
maxRPMs = numRPMs
-
+
values['hostArch'] = hostArch
hostArchList = server.getAllArches()
hostArchList.sort()
values['hostArchList'] = hostArchList
values['rpmArch'] = rpmArch
values['rpmArchList'] = hostArchList + ['noarch', 'src']
-
+
if order == None:
order = '-rpms'
values['order'] = order
@@ -1947,11 +1947,11 @@ def tasksbyhost(environ, start=None, order='-tasks',
hostArch=None):
server = _getServer(environ)
maxTasks = 1
-
+
hostArchFilter = hostArch
if hostArchFilter == 'ix86':
hostArchFilter = ['i386', 'i486', 'i586', 'i686']
-
+
hosts = server.listHosts(arches=hostArchFilter)
server.multicall = True
@@ -1963,12 +1963,12 @@ def tasksbyhost(environ, start=None, order='-tasks',
hostArch=None):
host['tasks'] = numTasks
if numTasks > maxTasks:
maxTasks = numTasks
-
+
values['hostArch'] = hostArch
hostArchList = server.getAllArches()
hostArchList.sort()
values['hostArchList'] = hostArchList
-
+
values['order'] = order
graphWidth = 400.0
@@ -1984,7 +1984,7 @@ def tasksbyuser(environ, start=None, order='-tasks'):
server = _getServer(environ)
maxTasks = 1
-
+
users = server.listUsers()
server.multicall = True
@@ -1996,7 +1996,7 @@ def tasksbyuser(environ, start=None, order='-tasks'):
user['tasks'] = numTasks
if numTasks > maxTasks:
maxTasks = numTasks
-
+
values['order'] = order
graphWidth = 400.0
@@ -2025,7 +2025,7 @@ def buildsbystatus(environ, days='7'):
server.listBuilds(completeAfter=dateAfter,
state=koji.BUILD_STATES['FAILED'], taskID=-1, queryOpts={'countOnly': True})
server.listBuilds(completeAfter=dateAfter,
state=koji.BUILD_STATES['CANCELED'], taskID=-1, queryOpts={'countOnly': True})
[[numSucceeded], [numFailed], [numCanceled]] = server.multiCall()
-
+
values['numSucceeded'] = numSucceeded
values['numFailed'] = numFailed
values['numCanceled'] = numCanceled
@@ -2070,7 +2070,7 @@ def buildsbytarget(environ, days='7', start=None,
order='-builds'):
if builds > maxBuilds:
maxBuilds = builds
- kojiweb.util.paginateList(values, targets.values(), start, 'targets',
'target', order)
+ kojiweb.util.paginateList(values, targets.values(), start, 'targets',
'target', order)
values['order'] = order
@@ -2140,7 +2140,7 @@ def recentbuilds(environ, user=None, tag=None,
package=None):
task = None
builds[i]['task'] = task
builds[i]['changelog'] = clogs[i][0]
-
+
values['tag'] = tagObj
values['user'] = userObj
values['package'] = packageObj
@@ -2197,7 +2197,7 @@ def search(environ, start=None, order='name'):
raise koji.GenericError, 'unknown search type: %s' % type
values['infoURL'] = infoURL
values['order'] = order
-
+
results = kojiweb.util.paginateMethod(server, values, 'search',
args=(terms, type, match),
start=start,
dataName='results', prefix='result', order=order)
if not start and len(results) == 1:
diff --git a/www/lib/kojiweb/util.py b/www/lib/kojiweb/util.py
index ae00757..ebb9f49 100644
--- a/www/lib/kojiweb/util.py
+++ b/www/lib/kojiweb/util.py
@@ -225,7 +225,7 @@ def passthrough_except(template, *exclude):
previously used
#attr _PASSTHROUGH = ...
to define the list of variable names to be passed-through.
- Any variables names passed in will be excluded from the
+ Any variables names passed in will be excluded from the
list of variables in the output string.
"""
passvars = []
@@ -245,7 +245,7 @@ def sortByKeyFunc(key, noneGreatest=False):
cmpFunc = lambda a, b: (a is None or b is None) and -(cmp(a, b)) or
cmp(a, b)
else:
cmpFunc = cmp
-
+
if key.startswith('-'):
key = key[1:]
sortFunc = lambda a, b: cmpFunc(b[key], a[key])
@@ -265,7 +265,7 @@ def paginateList(values, data, start, dataName,
prefix=None, order=None, noneGre
"""
if order != None:
data.sort(sortByKeyFunc(order, noneGreatest))
-
+
totalRows = len(data)
if start:
@@ -277,7 +277,7 @@ def paginateList(values, data, start, dataName,
prefix=None, order=None, noneGre
count = len(data)
_populateValues(values, dataName, prefix, data, totalRows, start, count,
pageSize, order)
-
+
return data
def paginateMethod(server, values, methodName, args=None, kw=None,
@@ -294,10 +294,10 @@ def paginateMethod(server, values, methodName, args=None,
kw=None,
start = 0
if not dataName:
raise StandardError, 'dataName must be specified'
-
+
kw['queryOpts'] = {'countOnly': True}
totalRows = getattr(server, methodName)(*args, **kw)
-
+
kw['queryOpts'] = {'order': order,
'offset': start,
'limit': pageSize}
@@ -402,7 +402,7 @@ def formatDep(name, version, flags):
a human-readable format. Copied from
rpmUtils/miscutils.py:formatRequires()"""
s = name
-
+
if flags:
if flags & (koji.RPMSENSE_LESS | koji.RPMSENSE_GREATER |
koji.RPMSENSE_EQUAL):
@@ -567,4 +567,3 @@ a network issue or load issues on the server."""
else:
str = "An error has occurred while processing your request."
return str, level
-