From a619651e9c393f2085d3383b0ca410690edd5d60 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Thu, 8 Aug 2013 23:21:53 +0100 Subject: [PATCH] Remove some old weird methods Definitely no need to retain "compatibility methods". Let's just fix the code which uses the old names. cached_version_string() doesn't seem to do anything useful anymore either. Change-Id: I00b0033ef3ada170941caf13fea74918cce59048 --- oslo/version/version.py | 17 ----------------- tests/test_version.py | 12 ------------ 2 files changed, 29 deletions(-) diff --git a/oslo/version/version.py b/oslo/version/version.py index 9327af4..70077a6 100644 --- a/oslo/version/version.py +++ b/oslo/version/version.py @@ -257,20 +257,3 @@ class VersionInfo(object): def suffix_string(self): self._load_vendor_strings() return self.suffix - - # Compatibility functions - canonical_version_string = version_string - version_string_with_vcs = release_string - package_string = suffix_string - - def cached_version_string(self, prefix=""): - """Generate an object which will expand in a string context to - the results of version_string(). We do this so that don't - call into pkg_resources every time we start up a program when - passing version information into the CONF constructor, but - rather only do the calculation when and if a version is requested - """ - if not self._cached_version: - self._cached_version = "%s%s" % (prefix, - self.version_string()) - return self._cached_version diff --git a/tests/test_version.py b/tests/test_version.py index 031302e..9ab9e89 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -23,18 +23,6 @@ from oslo.version import version import tests -class DeferredVersionTestCase(tests.BaseTestCase): - - def test_cached_version(self): - class MyVersionInfo(version.VersionInfo): - def _get_version_from_pkg_resources(self): - return "5.5.5.5" - - deferred_string = MyVersionInfo("openstack").\ - cached_version_string() - self.assertEqual("5.5.5.5", deferred_string) - - class FindConfigFilesTestCase(tests.BaseTestCase): def _monkey_patch(self, config_files):