Browse Source

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
changes/28/564628/3
James E. Blair 3 years ago
parent
commit
a30eee31b5
  1. 6
      zuul/scheduler.py
  2. 15
      zuul/version.py

6
zuul/scheduler.py

@ -257,7 +257,11 @@ class Scheduler(threading.Thread):
'/var/lib/zuul/scheduler.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.tenant_last_reconfigured = {}
self.autohold_requests = {}

15
zuul/version.py

@ -15,6 +15,21 @@
# License for the specific language governing permissions and limitations
# under the License.
import json
import pbr.version
import pkg_resources
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…
Cancel
Save