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
This commit is contained in:
Mark McLoughlin 2013-08-08 23:21:53 +01:00
parent 5bee3dd3e5
commit a619651e9c
2 changed files with 0 additions and 29 deletions

View File

@ -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

View File

@ -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):