16 Commits

Author SHA1 Message Date
Mark McLoughlin
94d87bce21 Remove nova.config.CONF
Modules import nova.config for two reasons right now - firstly, to
reference nova.config.CONF and, secondly, if they use one of the
options defined in nova.config.

Often modules import nova.openstack.common.cfg and nova.config
which is a bit pointless since they could just use cfg.CONF if
they just want to nova.config in order to reference CONF.

Let's just use cfg.CONF everywhere and we can explicitly state
where we actually require options defined in nova.config.

Change-Id: Ie4184a74e3e78c99658becb18dce1c2087e450bb
2012-11-20 00:00:21 +00:00
Luis Fernandez Alvarez
5dd1553cca Replaced default hostname function from gethostname to getfqdn
Fixes bug 1055503

The standard behaviour of the 'gethostname' function in Python differs from
Linux to Windows. A common Linux configuration returns the FQDN, while a
Windows one returns only the host name.

To resolve inconsistent node naming in deployments that mix windows and
Linux, it is proposed to use 'getfqdn' as default function instead of
'gethostname'. This is function is more predictable in all cases.

Change-Id: I3164d9a36df2b8484bbf9a57879c31fa0e342503
2012-09-26 13:43:16 +02:00
Yosef Berman
c5d724ff57 Added script to find unused config options.
The script analyze_opts.py is added to identify unused options
and options which are set to default values in the nova.conf file.

Change-Id: Iec42781a56f73b7d0960bdd569f5dd06edbb88df
2012-09-18 13:36:03 -07:00
Jenkins
5c5ee02a7d Merge "Ensure log formats are quoted in sample conf" 2012-08-24 16:33:50 +00:00
Jenkins
30fd506e23 Merge "Don't include hostname and IP in generated sample conf" 2012-08-24 16:33:30 +00:00
Jenkins
13937c028d Merge "Allow generate_sample.sh to be run from toplevel dir" 2012-08-23 20:23:09 +00:00
Mark McLoughlin
63cc191c2d Include CommonConfigOpts options in sample config
Options defined by CommonConfigOpts are declared within the class rather
than at module level, so they weren't being included in the sample conf.

Also, in essex (and up until commit 991614add8), the sample conf file
didn't contain these options but they included the hyphen in the name.
The hyphen is only used on the command line, it is converted to an
underscore automatically in the config file. Use opt.dest rather than
opt.name as the config file key. Fixes bug #1034970.

DocImpact: update nova.conf docs
Change-Id: Ia7f3dded9148deedeb198c19a8d343db6dd93f99
2012-08-23 12:09:06 +01:00
Mark McLoughlin
680c80d9ea Ensure log formats are quoted in sample conf
Fixes bug #1040583

This ensures the sample conf has:

  # instance_format="[instance: %(uuid)s] "

rather than:

  # instance_format=[instance: %(uuid)s]

Fix suggested by Vish.

Change-Id: If20aa7276d6868a6885abc85f046733adc40331f
DocImpact: update nova.conf docs
2012-08-23 12:03:06 +01:00
Mark McLoughlin
705ee5e660 Don't include hostname and IP in generated sample conf
Avoid including the hostname and IP address of the machine generating
the sample config file.

Change-Id: Idf791efef8b0bf760c4c95f6f5f53d20bdf5ee7a
2012-08-23 11:49:15 +01:00
Mark McLoughlin
46de1cc267 Allow generate_sample.sh to be run from toplevel dir
I hit an issue where extract_opts.py couldn't import importutils
since it's not in my sys.path, so it's clear we need to set
PYTHONPATH before running.

The whole business of running the tool from the tools/conf dir
is fairly awkward, so change it to run from the top-level dir
instead.

Change-Id: I89b4d874a6ee3732234a9704a8ee6001a293ed71
2012-08-23 10:37:38 +01:00
Derek Higgins
d5f888fc7a Removing double quotes from sample config file
Fixes bug #1005869

Changing create_conf.py to no longer include quotes for
StrOpt, ListOpt and MultiStrOpt types, Also regenerating
and new version of etc/nova/nova.conf.sample

Change-Id: I31c0a6cdcfd3e7cacaae6afbf75648ef0a34d668
2012-05-31 11:27:36 +01:00
Zhongyue Luo
991614add8 Sample config file tool updates
Fixes bug #1000133

Current method of extracting config options will not work
once the global config object gets removed.

1. Update tool to read a cfg.Opt subclass instance or list of cfg.Opt subclass
   instances rather than the FLAG object.
2. Word wrap help messages
3. Insert line between consecutive options
4. Print warnings for missing option help string

Change-Id: Idd17048b6e8db6e939946968e011e68da8585b8c
2012-05-31 05:44:46 +08:00
Mark McLoughlin
9120a7df37 Hack to fixup absolute pybasedir in nova.conf.sample
We want to avoid e.g. /home/markmc or /Users/vishvananda in this
file.

/usr/lib/python/site-packages is pretty dumb too, but it's suffices
as an example.

Change-Id: I851841a30ca01790c7b5a9b6bdbd160f4a84467c
2012-03-09 15:37:02 +00:00
Vishvananda Ishaya
6ee8a083f0 Cleans up the create_conf tool
* Makes it adhere to the config file format
 * Puts the sample output in etc/nova/nova.conf.sample
 * Updating sample is as easy as ./tools/conf/generate_sample.sh

Change-Id: I01e72cb58dd598a74f50c2c17f102d24df325f2e
2012-03-06 17:53:17 -08:00
Zhongyue Luo
cce1c217eb Nova options tool enhancements
Fixes bug #936898

1. Just import the modules and only look at nova.flags.FLAGS
   when they're all imported

2. ConfigOpts is iterable, there should be no need to iterate
   the private FLAGS._opts dict

3. Output should be .ini style

4. The output should only contain comments
   i.e. each option default should be commented out

Change-Id: I15835bb437bc6d575e8311d7c55b3a29d67b006d
2012-02-24 07:10:40 +08:00
Zhongyue Luo
9e16a2edb1 nova.conf sample tool
Fixes bug #918621

A tool to generate a sample nova.conf file

Change-Id: I2646d7e674ef3d1759558e820f051cc5e7f3b4ae
2012-02-18 07:51:46 +08:00