-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdatecache.py
More file actions
32 lines (27 loc) · 992 Bytes
/
updatecache.py
File metadata and controls
32 lines (27 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from buildbot.process import buildstep
from buildbot.process import remotecommand
from buildbot.status.results import FAILURE
from buildbot.status.results import SUCCESS
from sourcecache import SourceCachePackage
class UpdateCache(buildstep.BuildStep):
name = 'update cache'
renderables = ['pkg']
haltOnFailure = True
flunkOnFailure = True
def __init__(self, pkg, **k):
buildstep.BuildStep.__init__(self,**k)
self.pkg = pkg
def start(self):
pkg = SourceCachePackage(self.pkg)
cmd = remotecommand.RemoteCommand('updateCache',{
'_package':pkg})
d = self.runCommand(cmd)
d.addCallback(lambda res: self.commandComplete(cmd))
d.addErrback(self.failed)
def commandComplete(self, cmd):
if cmd.didFail():
self.descriptionDone = ["ECHO Failed (?)"]
self.finished(FAILURE)
return
self.descriptionDone = ["done"]
self.finished(SUCCESS)