Merge lp:~ken-pepple/nova/add-version-to-nova-manage into lp:~hudson-openstack/nova/trunk

Proposed by Ken Pepple
Status: Merged
Approved by: Todd Willey
Approved revision: 1037
Merged at revision: 1036
Proposed branch: lp:~ken-pepple/nova/add-version-to-nova-manage
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 48 lines (+16/-1)
1 file modified
bin/nova-manage (+16/-1)
To merge this branch: bzr merge lp:~ken-pepple/nova/add-version-to-nova-manage
Reviewer Review Type Date Requested Status
Todd Willey (community) Approve
justinsb (community) Approve
Review via email: mp+59313@code.launchpad.net

Description of the change

added nova version to usage output of bin/nova-manage for easy identification of installed codebase

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

This is good but can you add the same output for "nova-manage version"?

Revision history for this message
Ken Pepple (ken-pepple) wrote :

soooo ... because of how the nova-manage logic works ($ nova-manage command subcommand), we need to actually have `$ nova-manage version show` ... which is ugly :)

i've added it into the changeset with an eye of expanding it to identify/fix the "i've upgraded my nova-api but not my nova-compute/nova-network/nova-volume" db version mismatch later.

the command is now:

   $ bin/nova-manage version list
   2011.3-dev (2011.3-LOCALBRANCH:LOCALREVISION)

but i've also left it in plain nova-manage:

    $ bin/nova-manage

    OpenStack Nova version: 2011.3-dev (2011.3-LOCALBRANCH:LOCALREVISION)

    bin/nova-manage category action [<args>]
    Available categories:
 user
 account
 project
 role
 shell
 vpn
 fixed
 floating
 network
 vm
 service
 db
 volume
 instance_type
 image
 flavor
 version

Revision history for this message
justinsb (justin-fathomdb) wrote :

Looks useful, but can you fix the comment so it doesn't talk about the database please - I thought this was showing the db migration version at first...

I can see that we'll want to show a bunch of versions in future, so I like the fact that this is a top level command (DB, API, extensions, etc)

review: Needs Fixing
Revision history for this message
Ken Pepple (ken-pepple) wrote :

jsb: you caught me cut-n-pasting :( fixed.

Revision history for this message
justinsb (justin-fathomdb) wrote :

Thanks for fixing!

review: Approve
Revision history for this message
Todd Willey (xtoddx) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/nova-manage'
--- bin/nova-manage 2011-04-22 07:14:11 +0000
+++ bin/nova-manage 2011-04-28 19:51:19 +0000
@@ -82,6 +82,7 @@
82from nova import quota82from nova import quota
83from nova import rpc83from nova import rpc
84from nova import utils84from nova import utils
85from nova import version
85from nova.api.ec2 import ec2utils86from nova.api.ec2 import ec2utils
86from nova.auth import manager87from nova.auth import manager
87from nova.cloudpipe import pipelib88from nova.cloudpipe import pipelib
@@ -758,6 +759,17 @@
758 print migration.db_version()759 print migration.db_version()
759760
760761
762class VersionCommands(object):
763 """Class for exposing the codebase version."""
764
765 def __init__(self):
766 pass
767
768 def list(self):
769 print _("%s (%s)") %\
770 (version.version_string(), version.version_string_with_vcs())
771
772
761class VolumeCommands(object):773class VolumeCommands(object):
762 """Methods for dealing with a cloud in an odd state"""774 """Methods for dealing with a cloud in an odd state"""
763775
@@ -1049,7 +1061,8 @@
1049 ('volume', VolumeCommands),1061 ('volume', VolumeCommands),
1050 ('instance_type', InstanceTypeCommands),1062 ('instance_type', InstanceTypeCommands),
1051 ('image', ImageCommands),1063 ('image', ImageCommands),
1052 ('flavor', InstanceTypeCommands)]1064 ('flavor', InstanceTypeCommands),
1065 ('version', VersionCommands)]
10531066
10541067
1055def lazy_match(name, key_value_tuples):1068def lazy_match(name, key_value_tuples):
@@ -1091,6 +1104,8 @@
10911104
1092 script_name = argv.pop(0)1105 script_name = argv.pop(0)
1093 if len(argv) < 1:1106 if len(argv) < 1:
1107 print _("\nOpenStack Nova version: %s (%s)\n") %\
1108 (version.version_string(), version.version_string_with_vcs())
1094 print script_name + " category action [<args>]"1109 print script_name + " category action [<args>]"
1095 print _("Available categories:")1110 print _("Available categories:")
1096 for k, _v in CATEGORIES:1111 for k, _v in CATEGORIES: