Merge lp:~jshepher/nova/nova_manage_config_list into lp:~hudson-openstack/nova/trunk

Proposed by Justin Shepherd
Status: Merged
Approved by: Vish Ishaya
Approved revision: 1144
Merged at revision: 1152
Proposed branch: lp:~jshepher/nova/nova_manage_config_list
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 50 lines (+22/-11)
1 file modified
bin/nova-manage (+22/-11)
To merge this branch: bzr merge lp:~jshepher/nova/nova_manage_config_list
Reviewer Review Type Date Requested Status
Vish Ishaya (community) Approve
Devin Carlen (community) Approve
Review via email: mp+63419@code.launchpad.net

Description of the change

Added 'config list' to nova-manage. This function will output all of the flags and their values.

# ./bin/nova-manage config list
--storage_availability_zone=nova
--ca_file=cacert.pem
--ec2_dmz_host=$my_ip
--fixed_range=10.0.0.0/8
--compute_topic=compute
--dmz_mask=255.255.255.0
****SNIP****

I also alphabetized the nova-manage category listing

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

nice!

review: Approve
Revision history for this message
Vish Ishaya (vishvananda) wrote :

hmm, I wonder about changing this slightly...

--help prints all of the flags with descriptions nicely categorized with default values
--helpxml prints in xml the same thing + the current value of the flag

We could pretty easily override --help to add the current value of the flag which might be a little nicer than that format?

Revision history for this message
Justin Shepherd (jshepher) wrote :

--help might get a bit hard to read with all the defaults, value types, and current values.. but let me know if that is the way I should go with this.

the other option.. is to not use the string format "--dmz_mask=255.255.255.0" but to use key:value (dmz_mask: 255.255.255.0)

Revision history for this message
Justin Shepherd (jshepher) wrote :

however, in the spirit of the example postconf.. it is nice for an administrator to have a function that just spits out all of the configuration paramaters with out any descriptions or defaults.. this is very nice when you just want to grep the running config for something:

Example:

# ./bin/nova-manage config list | grep -i glance
--glance_port=9292
--glance_host=$my_ip

# ./bin/nova-manage --help | grep -A2 -i glance
  --glance_host: glance host
    (default: '$my_ip')
  --glance_port: glance port
    (default: '9292')
    (an integer)

Revision history for this message
Vish Ishaya (vishvananda) wrote :

ok. I buy that rationale.

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-06-03 15:11:01 +0000
+++ bin/nova-manage 2011-06-03 18:23:23 +0000
@@ -1081,24 +1081,35 @@
1081 self._convert_images(machine_images)1081 self._convert_images(machine_images)
10821082
10831083
1084class ConfigCommands(object):
1085 """Class for exposing the flags defined by flag_file(s)."""
1086
1087 def __init__(self):
1088 pass
1089
1090 def list(self):
1091 print FLAGS.FlagsIntoString()
1092
1093
1084CATEGORIES = [1094CATEGORIES = [
1085 ('user', UserCommands),
1086 ('account', AccountCommands),1095 ('account', AccountCommands),
1096 ('config', ConfigCommands),
1097 ('db', DbCommands),
1098 ('fixed', FixedIpCommands),
1099 ('flavor', InstanceTypeCommands),
1100 ('floating', FloatingIpCommands),
1101 ('instance_type', InstanceTypeCommands),
1102 ('image', ImageCommands),
1103 ('network', NetworkCommands),
1087 ('project', ProjectCommands),1104 ('project', ProjectCommands),
1088 ('role', RoleCommands),1105 ('role', RoleCommands),
1106 ('service', ServiceCommands),
1089 ('shell', ShellCommands),1107 ('shell', ShellCommands),
1090 ('vpn', VpnCommands),1108 ('user', UserCommands),
1091 ('fixed', FixedIpCommands),1109 ('version', VersionCommands),
1092 ('floating', FloatingIpCommands),
1093 ('network', NetworkCommands),
1094 ('vm', VmCommands),1110 ('vm', VmCommands),
1095 ('service', ServiceCommands),
1096 ('db', DbCommands),
1097 ('volume', VolumeCommands),1111 ('volume', VolumeCommands),
1098 ('instance_type', InstanceTypeCommands),1112 ('vpn', VpnCommands)]
1099 ('image', ImageCommands),
1100 ('flavor', InstanceTypeCommands),
1101 ('version', VersionCommands)]
11021113
11031114
1104def lazy_match(name, key_value_tuples):1115def lazy_match(name, key_value_tuples):