Define a product, vendor & package strings in version.py

To have one single place where all code in Nova can access
product, vendor & package strings, extend version.py to
expose a product_string(), vendor_string() and package_string()
methods. The product will default to "OpenStack Nova", the
vendor to "OpenStack" and the package to None. The latter is
intended solely for OS distro vendors to include their package
version suffix (eg the "Release:" field from RPM or perhaps
a VCS tag)

Following changes will make this data configurable via a
plain text file, and then update various parts of Nova to
make use of the data.

Change-Id: I3eb14d11f8949ce909a8f529851913d3dccf0e8c
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2012-12-13 18:56:24 +00:00
parent cbf9d89738
commit ba9ee7eb22

View File

@ -14,11 +14,26 @@
# License for the specific language governing permissions and limitations
# under the License.
NOVA_VENDOR = "OpenStack Foundation"
NOVA_PRODUCT = "OpenStack Nova"
NOVA_PACKAGE = None # OS distro package version suffix
NOVA_VERSION = ['2013', '1', None]
YEAR, COUNT, REVISION = NOVA_VERSION
FINAL = False # This becomes true at Release Candidate time
def vendor_string():
return NOVA_VENDOR
def product_string():
return NOVA_PRODUCT
def package_string():
return NOVA_PACKAGE
def canonical_version_string():
return '.'.join(filter(None, NOVA_VERSION))