OLD | NEW |
| (Empty) |
1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 | |
6 """ JSON interface which gives the buildbot master's current code revision. """ | |
7 | |
8 | |
9 from buildbot.status.web.status_json import JsonResource | |
10 | |
11 import utils | |
12 | |
13 | |
14 class MasterCheckedOutRevisionJsonResource(JsonResource): | |
15 """Revision of the buildbot code on the build master.""" | |
16 help = ('Revision of the buildbot code on the build master, which may or may ' | |
17 'not be the revision which is actually running, see also ' | |
18 'MasterRunningRevisionJsonResource.') | |
19 pageTitle = 'Master Revision' | |
20 | |
21 def asDict(self, request): | |
22 return {'master_checkedout_revision': utils.get_current_revision()} | |
23 | |
24 | |
25 class MasterRunningRevisionJsonResource(JsonResource): | |
26 """Revision of the buildbot code which the build master is actually running. | |
27 """ | |
28 help = ('Revision of the buildbot code which the build master is actually ' | |
29 'running.') | |
30 pageTitle = 'Master Running Revision' | |
31 | |
32 def __init__(self, running_revision, **kwargs): | |
33 JsonResource.__init__(self, **kwargs) | |
34 self._running_revision = running_revision | |
35 | |
36 def asDict(self, request): | |
37 return {'master_running_revision': self._running_revision} | |
OLD | NEW |