From a721810ab077b767f3817511d5d448f741608b75 Mon Sep 17 00:00:00 2001 From: Ilya Shakhat Date: Thu, 5 Sep 2013 15:40:32 +0400 Subject: [PATCH] Added version info into UI * Version and build is shown as tooltip of 'About' link * Explicit version is removed from setup.cfg * Build directory is added into pep8 ignore list Resolves bug 1218934 Change-Id: Ideac6fa18580c1298d24212a8b1dbad0ef39b7b1 --- dashboard/templates/layout.html | 2 +- dashboard/web.py | 5 +++++ setup.cfg | 1 - tox.ini | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dashboard/templates/layout.html b/dashboard/templates/layout.html index 6140e8991..d5e7fe1f4 100644 --- a/dashboard/templates/layout.html +++ b/dashboard/templates/layout.html @@ -391,7 +391,7 @@
- About ↗ + About ↗
diff --git a/dashboard/web.py b/dashboard/web.py index cf10e4473..5d79fff3b 100644 --- a/dashboard/web.py +++ b/dashboard/web.py @@ -33,6 +33,7 @@ from stackalytics.openstack.common import log as logging from stackalytics.processor import config from stackalytics.processor import runtime_storage from stackalytics.processor import utils +from stackalytics import version as stackalytics_version # Constants and Parameters --------- @@ -498,6 +499,10 @@ def templated(template=None, return_code=200): ctx['user_id'] = get_single_parameter(kwargs, 'user_id') ctx['page_title'] = make_page_title(ctx['company'], ctx['user_id'], ctx['module'], ctx['release']) + ctx['stackalytics_version'] = ( + stackalytics_version.version_info.version_string()) + ctx['stackalytics_release'] = ( + stackalytics_version.version_info.release_string()) return flask.render_template(template_name, **ctx), return_code diff --git a/setup.cfg b/setup.cfg index 55e813063..9999bca8c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,5 @@ [metadata] name = stackalytics -version = 0.1 summary = OpenStack analytics dashboard description-file = README.rst diff --git a/tox.ini b/tox.ini index 1d6dbefd3..ca4e4c101 100644 --- a/tox.ini +++ b/tox.ini @@ -33,4 +33,4 @@ commands = python setup.py build_sphinx ignore = E125,H404 show-source = true builtins = _ -exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools +exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,build