CLI for save_failed_tree
This commit is contained in:
parent
a5131cec91
commit
437afbb720
5 changed files with 182 additions and 3 deletions
|
|
@ -6,6 +6,7 @@ from __main__ import BuildRoot
|
|||
|
||||
__all__ = ('SaveFailedTreeTask',)
|
||||
|
||||
|
||||
def omit_ccache(tarinfo):
|
||||
if fnmatch.fnmatch(tarinfo.name, '*/tmp/krb5cc') or \
|
||||
fnmatch.fnmatch(tarinfo.name, '*/etc/*.keytab'):
|
||||
|
|
@ -14,12 +15,10 @@ def omit_ccache(tarinfo):
|
|||
return tarinfo
|
||||
|
||||
|
||||
|
||||
class SaveFailedTreeTask(tasks.BaseTaskHandler):
|
||||
Methods = ['saveFailedTree']
|
||||
_taskWeight = 3.0
|
||||
|
||||
|
||||
def handler(self, taskID, full=False):
|
||||
self.logger.debug("Starting saving buildroots for task %d [full=%s]" % (taskID, full))
|
||||
tar_path = os.path.join(self.workdir, 'broots-task-%s.tar.gz' % taskID)
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
import sys
|
||||
import koji
|
||||
from koji.plugin import export
|
||||
|
||||
import sys
|
||||
sys.path.insert(0, '/usr/share/koji-hub/')
|
||||
import kojihub
|
||||
|
||||
__all__ = ('saveFailedTree',)
|
||||
|
||||
|
||||
@export
|
||||
def saveFailedTree(taskID, full=False, **opts):
|
||||
'''xmlrpc method for creating saveFailedTree task. If arguments are
|
||||
invalid, error message is returned. Otherwise task id of newly created
|
||||
task is returned.'''
|
||||
|
||||
# let it raise errors
|
||||
taskID = int(taskID)
|
||||
full = bool(full)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue