Report git sha in status page version
If the installed version of Zuul is not a release, report the git sha along with the version on the status page. This is calculated at startup and so should not change during the life of the process. Change-Id: Ia48a3765f0dd7ef369b2b30ac1d79cc1f52045b6
This commit is contained in:
parent
f3194ce547
commit
a30eee31b5
|
@ -257,7 +257,11 @@ class Scheduler(threading.Thread):
|
||||||
'/var/lib/zuul/scheduler.socket')
|
'/var/lib/zuul/scheduler.socket')
|
||||||
self.command_socket = commandsocket.CommandSocket(command_socket)
|
self.command_socket = commandsocket.CommandSocket(command_socket)
|
||||||
|
|
||||||
self.zuul_version = zuul_version.version_info.release_string()
|
if zuul_version.is_release is False:
|
||||||
|
self.zuul_version = "%s %s" % (zuul_version.release_string,
|
||||||
|
zuul_version.git_version)
|
||||||
|
else:
|
||||||
|
self.zuul_version = zuul_version.release_string
|
||||||
self.last_reconfigured = None
|
self.last_reconfigured = None
|
||||||
self.tenant_last_reconfigured = {}
|
self.tenant_last_reconfigured = {}
|
||||||
self.autohold_requests = {}
|
self.autohold_requests = {}
|
||||||
|
|
|
@ -15,6 +15,21 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
import pbr.version
|
import pbr.version
|
||||||
|
import pkg_resources
|
||||||
|
|
||||||
version_info = pbr.version.VersionInfo('zuul')
|
version_info = pbr.version.VersionInfo('zuul')
|
||||||
|
release_string = version_info.release_string()
|
||||||
|
|
||||||
|
is_release = None
|
||||||
|
git_version = None
|
||||||
|
try:
|
||||||
|
_metadata = json.loads(
|
||||||
|
pkg_resources.get_distribution('zuul').get_metadata('pbr.json'))
|
||||||
|
if _metadata:
|
||||||
|
is_release = _metadata['is_release']
|
||||||
|
git_version = _metadata['git_version']
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
Loading…
Reference in New Issue