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
1=== modified file 'bin/nova-manage'
2--- bin/nova-manage 2011-04-22 07:14:11 +0000
3+++ bin/nova-manage 2011-04-28 19:51:19 +0000
4@@ -82,6 +82,7 @@
5 from nova import quota
6 from nova import rpc
7 from nova import utils
8+from nova import version
9 from nova.api.ec2 import ec2utils
10 from nova.auth import manager
11 from nova.cloudpipe import pipelib
12@@ -758,6 +759,17 @@
13 print migration.db_version()
14
15
16+class VersionCommands(object):
17+ """Class for exposing the codebase version."""
18+
19+ def __init__(self):
20+ pass
21+
22+ def list(self):
23+ print _("%s (%s)") %\
24+ (version.version_string(), version.version_string_with_vcs())
25+
26+
27 class VolumeCommands(object):
28 """Methods for dealing with a cloud in an odd state"""
29
30@@ -1049,7 +1061,8 @@
31 ('volume', VolumeCommands),
32 ('instance_type', InstanceTypeCommands),
33 ('image', ImageCommands),
34- ('flavor', InstanceTypeCommands)]
35+ ('flavor', InstanceTypeCommands),
36+ ('version', VersionCommands)]
37
38
39 def lazy_match(name, key_value_tuples):
40@@ -1091,6 +1104,8 @@
41
42 script_name = argv.pop(0)
43 if len(argv) < 1:
44+ print _("\nOpenStack Nova version: %s (%s)\n") %\
45+ (version.version_string(), version.version_string_with_vcs())
46 print script_name + " category action [<args>]"
47 print _("Available categories:")
48 for k, _v in CATEGORIES: