summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-12-17 12:17:59 +0000
committerDaniel P. Berrange <berrange@redhat.com>2012-12-19 18:54:17 +0000
commit481d6ff142b8daeb08b22001997b5cf701a6d134 (patch)
tree8b6f8fc1389817475bc4b7d7f596c6b505cd36dc
parentba9ee7eb22ca17553e2e768365220c9a9838ae1d (diff)
downloadnova-481d6ff142b8daeb08b22001997b5cf701a6d134.tar.gz
nova-481d6ff142b8daeb08b22001997b5cf701a6d134.tar.xz
nova-481d6ff142b8daeb08b22001997b5cf701a6d134.zip
Remove obsolete VCS version info completely
The VCS version string in nova/version.py has been hardcoded to 'LOCALBRANCH:LOCALVERSION' since change 0bbb0e8cb1daa351af91cf97b2bcababfc0c7f9f The only places which use this info are some logging calls, and since 'nova-manager version' command. The latter would more usefully output the distro specific package string. Delete the VCS related methods in version.py and replace their usage with a new method version_string_with_package() which appends the distro-specific package tag Change-Id: I972b79c329198cb5376d537c6b672830094cd759 Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
-rwxr-xr-xbin/nova-manage4
-rw-r--r--nova/service.py6
-rw-r--r--nova/tests/test_versions.py12
-rw-r--r--nova/version.py11
-rw-r--r--nova/vnc/xvp_proxy.py2
5 files changed, 14 insertions, 21 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index c761ff6cc..2ff96f50d 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -1100,9 +1100,7 @@ def main():
sys.exit(2)
if CONF.category.name == "version":
- print (_("%(version)s (%(vcs)s)") %
- {'version': version.version_string(),
- 'vcs': version.version_string_with_vcs()})
+ print version.version_string_with_package()
sys.exit(0)
if CONF.category.name == "bash-completion":
diff --git a/nova/service.py b/nova/service.py
index fb21c3e0c..4c93fefa8 100644
--- a/nova/service.py
+++ b/nova/service.py
@@ -388,9 +388,9 @@ class Service(object):
self.servicegroup_api = servicegroup.API()
def start(self):
- vcs_string = version.version_string_with_vcs()
- LOG.audit(_('Starting %(topic)s node (version %(vcs_string)s)'),
- {'topic': self.topic, 'vcs_string': vcs_string})
+ verstr = version.version_string_with_package()
+ LOG.audit(_('Starting %(topic)s node (version %(version)s)'),
+ {'topic': self.topic, 'version': verstr})
self.manager.init_host()
self.model_disconnected = False
ctxt = context.get_admin_context()
diff --git a/nova/tests/test_versions.py b/nova/tests/test_versions.py
index cec418aee..68e77ff9e 100644
--- a/nova/tests/test_versions.py
+++ b/nova/tests/test_versions.py
@@ -31,6 +31,7 @@ class VersionTestCase(test.TestCase):
self.version.version_info = {'branch_nick': u'LOCALBRANCH',
'revision_id': 'LOCALREVISION',
'revno': 0}
+ self.version.NOVA_PACKAGE = "g9ec3421"
def test_version_string_is_good(self):
"""Ensure version string works"""
@@ -48,12 +49,7 @@ class VersionTestCase(test.TestCase):
self.assertEqual(self.version.canonical_version_string(),
self.version.version_string())
- def test_vcs_version_string_is_good(self):
- """Ensure uninstalled code generates local """
- self.assertEqual("LOCALBRANCH:LOCALREVISION",
- self.version.vcs_version_string())
-
- def test_version_string_with_vcs_is_good(self):
+ def test_version_string_with_package_is_good(self):
"""Ensure uninstalled code get version string"""
- self.assertEqual("2012.10-LOCALBRANCH:LOCALREVISION",
- self.version.version_string_with_vcs())
+ self.assertEqual("2012.10-g9ec3421",
+ self.version.version_string_with_package())
diff --git a/nova/version.py b/nova/version.py
index eb05058f3..16b0d876a 100644
--- a/nova/version.py
+++ b/nova/version.py
@@ -45,9 +45,8 @@ def version_string():
return '%s-dev' % (canonical_version_string(),)
-def vcs_version_string():
- return 'LOCALBRANCH:LOCALREVISION'
-
-
-def version_string_with_vcs():
- return '%s-%s' % (canonical_version_string(), vcs_version_string())
+def version_string_with_package():
+ if package_string() is None:
+ return canonical_version_string()
+ else:
+ return "%s-%s" % (canonical_version_string(), package_string())
diff --git a/nova/vnc/xvp_proxy.py b/nova/vnc/xvp_proxy.py
index 59b80994b..9489b949a 100644
--- a/nova/vnc/xvp_proxy.py
+++ b/nova/vnc/xvp_proxy.py
@@ -174,7 +174,7 @@ class SafeHttpProtocol(eventlet.wsgi.HttpProtocol):
def get_wsgi_server():
LOG.audit(_("Starting nova-xvpvncproxy node (version %s)"),
- version.version_string_with_vcs())
+ version.version_string_with_package())
return wsgi.Server("XCP VNC Proxy",
XCPVNCProxy(),