summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2013-08-08 23:21:53 +0100
committerMark McLoughlin <markmc@redhat.com>2013-10-21 14:06:09 +0100
commita619651e9c393f2085d3383b0ca410690edd5d60 (patch)
treec95191fc3cb1a11e46704ffd7be30356de64e8db
parent5bee3dd3e5a880651fdab71906994d27a20b327f (diff)
downloadoslo-version-a619651e9c393f2085d3383b0ca410690edd5d60.tar.gz
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
-rw-r--r--oslo/version/version.py17
-rw-r--r--tests/test_version.py12
2 files changed, 0 insertions, 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):