summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Pepple <ken.pepple@gmail.com>2011-04-29 20:11:19 +0000
committerTarmac <>2011-04-29 20:11:19 +0000
commit9d76e52e4ac032973dd75d44e4978e7d42d33d40 (patch)
tree184f411a7b53974fbe6096b5c000f3b1b457c4bb
parent28f41bf8bd385ec423d1f5c1ec2798e60832117f (diff)
parentad077fc137cc6a1dfdcd60349560abb94f4cc8eb (diff)
downloadnova-9d76e52e4ac032973dd75d44e4978e7d42d33d40.tar.gz
nova-9d76e52e4ac032973dd75d44e4978e7d42d33d40.tar.xz
nova-9d76e52e4ac032973dd75d44e4978e7d42d33d40.zip
added nova version to usage output of bin/nova-manage for easy identification of installed codebase
-rwxr-xr-xbin/nova-manage17
1 files changed, 16 insertions, 1 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index c8230670a..8122e6745 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -82,6 +82,7 @@ from nova import log as logging
from nova import quota
from nova import rpc
from nova import utils
+from nova import version
from nova.api.ec2 import ec2utils
from nova.auth import manager
from nova.cloudpipe import pipelib
@@ -758,6 +759,17 @@ class DbCommands(object):
print migration.db_version()
+class VersionCommands(object):
+ """Class for exposing the codebase version."""
+
+ def __init__(self):
+ pass
+
+ def list(self):
+ print _("%s (%s)") %\
+ (version.version_string(), version.version_string_with_vcs())
+
+
class VolumeCommands(object):
"""Methods for dealing with a cloud in an odd state"""
@@ -1049,7 +1061,8 @@ CATEGORIES = [
('volume', VolumeCommands),
('instance_type', InstanceTypeCommands),
('image', ImageCommands),
- ('flavor', InstanceTypeCommands)]
+ ('flavor', InstanceTypeCommands),
+ ('version', VersionCommands)]
def lazy_match(name, key_value_tuples):
@@ -1091,6 +1104,8 @@ def main():
script_name = argv.pop(0)
if len(argv) < 1:
+ print _("\nOpenStack Nova version: %s (%s)\n") %\
+ (version.version_string(), version.version_string_with_vcs())
print script_name + " category action [<args>]"
print _("Available categories:")
for k, _v in CATEGORIES: