464 Commits

Author SHA1 Message Date
Jenkins
e5a6e198a9 Merge "Work toward Python 3.4 support and testing" 2014-09-08 20:33:20 +00:00
Miguel Grinberg
a736da32e7 Fixed typo in docstring for _get_config_dirs
The docstring for function _get_config_dirs() refers to directories
as "directors".

Change-Id: Iede3934a9712de98dc1f39604d5dc210fbfc4672
2014-09-04 23:16:30 +00:00
Doug Hellmann
ba6486aa40 Update contributing instructions
Point contributors to the correct launchpad page.

Change-Id: I4ce980a8957a186ec3e1b4be2e0ee3ecf333b849
2014-09-04 15:30:07 -04:00
OpenStack Proposal Bot
6acc2dde71 Updated from global requirements
Change-Id: Id105ee1d495144517a684edd49116cba24060529
2014-09-04 17:54:35 +00:00
Jeremy Stanley
7a091ce8ed Work toward Python 3.4 support and testing
Change-Id: Iadb1b695b8314d385716619561a1604a41f6c8d5
2014-09-03 19:04:36 +00:00
Doug Hellmann
64d3484748 warn against sorting requirements
Change-Id: I64ae9191863564e278a35d42ec9cd743a233028e
Addresses-Bug: #1365061
2014-09-03 14:18:17 -04:00
Flavio Percoco
10fa16906e Explain groups for DeprecatedOpts
The patch extends the documentation for `DeprecatedOpt` and explains
that group==None means the deprecated name will be looked up in the same
group.

Change-Id: I54ba414d6a6862e1b00dfbf589563ef9f4df5cf3
2014-09-03 18:18:58 +02:00
Christian Berendt
70fc459542 Add missing newline to stderr output when argument value is wrong
For example when having an argument with possible choices and the used
choice is not available the stderr output is like the following example.

argument --formatting: Invalid String(choices=['check', 'fix']) value: fixaberendt@zitrone

To have the shell prompt at the next line it necessary to at '\n' at the
end of the stderr output.

Change-Id: I99152e69bb090ea5d7102cc85d60498c3c6213eb
2014-08-12 20:22:50 +02:00
Jenkins
dc5081aab5 Merge "Log a fixed length string of asterisks for obfuscation" 2014-08-06 17:43:39 +00:00
Jenkins
2cf77bbc59 Merge "Bump hacking to version 0.9.2" 2014-08-06 04:38:00 +00:00
Zhongyue Luo
a590c2afee Log a fixed length string of asterisks for obfuscation
Change-Id: I98e95dbc92712bebb18dcf0d29af7cfe7f2c8124
Closes-bug: #1341774
2014-08-05 10:38:50 +08:00
Chandan Kumar
46eabcca65 Added link to bug tracker and documentation in oslo.config readme
Change-Id: Ib92ca4f0f764ccf0e4f7680a0c30194bbe708d92
Closes-Bug: #1321953
2014-07-25 17:51:09 +05:30
Christian Berendt
4c1ada2420 Bump hacking to version 0.9.2
Change-Id: I4cb68964ccbc1ca54c242ad1b745229bb218bea5
2014-07-16 16:29:34 +02:00
Mark McLoughlin
a5ac14975e Update 1.4.0.0a2 release notes
One last change got merged before tagging.

Change-Id: I82e6c3c8a47966330e809e80897311e951af0f13
2014-07-11 06:51:36 +01:00
Jenkins
2d4aff8f12 Merge "generator: tweak how MultiStrOpt defaults are handled" 2014-07-10 22:38:06 +00:00
Jenkins
5d53ea479f Merge "Changes imports order to pass H305, enables check" 2014-07-10 22:17:53 +00:00
Petr Blaho
b416b5d011 Changes imports order to pass H305, enables check
Changes imports order to pass H305 check with hacking 0.9.x
Removes H305 check from ignore line in tox.ini

Change-Id: I47bbe74f4178f46ea21fc37b69f53ea2d148a65e
2014-07-09 08:01:21 -04:00
Mark McLoughlin
26eb1026f9 generator: tweak how MultiStrOpt defaults are handled
If a MultiStrOpt default is set to None or [], the best thing to do is
just add:

  #multi_str_opt =

to the sample config file.

Change-Id: Ibaee466978870082be47a2135ae3f412d3efd623
2014-07-09 09:11:02 +01:00
Mark McLoughlin
35c28108a3 Add release notes for 1.3.0 and 1.4.0.0a1/2
We appear to have stopped doing these since the 1.2.0 release, but I
like to do them because it helps highlight new APIs, behavior changes,
important bug fixes, new dependencies and also allows us to credit the
contibutors in a nice and friendly way.

Change-Id: I7dd6641a840dee0082c6c9e9216184f385869519
2014-07-08 18:57:41 +01:00
Mark McLoughlin
b7b63bb71e Hook up config fixture docs
Change-Id: I2da6ecfc2fafb09e8ce69733204a456b0e962ab6
2014-07-08 18:26:18 +01:00
Mark McLoughlin
020e68d8e8 Hook IPOpt class into the docs
Change-Id: I02b38b89f32db8b03a94467cdf5c6ff1c8865f2b
2014-07-08 17:57:10 +01:00
Jenkins
5cb7cdc189 Merge "Replaced 'e.g.' with 'for example'" 2014-07-08 15:09:27 +00:00
Jenkins
a5750d5839 Merge "generator: remove the default sanitizer feature" 2014-07-07 20:16:34 +00:00
Christian Berendt
eba14b3f74 Replaced 'e.g.' with 'for example'
According to the IBM Style Guide the Latin abbreviation 'e.g.'
should be replaced by 'for example'.

Change-Id: Ie85eec0f028a927a635303f7c13e76fe52a92ff5
2014-07-07 10:35:08 +02:00
Jenkins
5d68935e0f Merge "cfg,generator: add Opt.sample_default attribute" 2014-07-07 02:35:13 +00:00
Jenkins
ac2779d7ba Merge "generator: refactor MultiStrOpt handling" 2014-07-07 02:33:59 +00:00
Jenkins
28ef50e931 Merge "Add cfgfilter.ConfigFilter" 2014-07-05 19:33:57 +00:00
Mark McLoughlin
bcb8b7b8f6 Add cfgfilter.ConfigFilter
Add a new class designed to wrap cfg.ConfigOpts, with the following use cases
in mind:

1. Help enforce that a given module does not access options registered by
   another module, without first declaring those cross-module dependencies
   using import_opt().

2. Prevent private configuration opts from being visible to modules other than
   the one which registered it.

blueprint: oslo-config-cfgfilter
Change-Id: I477f7027806d7630ce91159fb274f41c0c203770
2014-07-03 15:07:35 +01:00
Mark McLoughlin
970f228186 generator: remove the default sanitizer feature
Now that we have an Opt.sample_default attribute, it's not very clear
we have a good use case for the sanitizer feature. Any default that we'd
want to sanitize in this way could probably just use sample_default
instead.

blueprint: oslo-config-generator
Change-Id: Ifd02bb66a2033afdaa5812b15941d2d485165863
2014-07-02 16:17:16 +01:00
Mark McLoughlin
a5c3f634a6 cfg,generator: add Opt.sample_default attribute
Some default values for configuration options are dynamic and
environment dependent. For example, an option might default to the
hostname of the machine.

However, such default values should never end up in a sample
configuration file - you don't want your hostname or path to your
personal home directory to be included in sample config files.

A simple solution to this is to add a 'sample_default' string
attribute which is used in place of a default, for those cases where
the real value is an unsuitable sample default. For example:

  cfg.StrOpt('hostname',
             default=get_my_host(),
             sample_default='myhostname')

blueprint: oslo-config-generator
Change-Id: I319d128a0a88b1197d8e2be105681f2b56240439
2014-07-02 16:17:16 +01:00
Mark McLoughlin
a72e49c3ec generator: refactor MultiStrOpt handling
This code was just confusing. Explicitly handle MultiStrOpt differently
from other types to make things more clear.

Change-Id: Ib6a01f76595c8874809c4d6db969ea8200d6fbb2
2014-07-02 16:17:16 +01:00
Jenkins
3d3ca2ac3f Merge "Add oslo-config-generator" 2014-07-02 14:51:34 +00:00
Jenkins
9f26394cb3 Merge "Add CLI option support to config fixture" 2014-07-02 13:15:51 +00:00
Jenkins
434383bbc1 Merge "Fix flaws in methods' docstring" 2014-06-30 14:16:41 +00:00
liu-sheng
2d6fe57413 Fix flaws in methods' docstring
Change-Id: Idaebbc5702daeabc22b44672ce7b7d301a725871
2014-06-30 15:55:27 +08:00
Jakub Libosvar
afab1f5266 Introduce Opts for IP addresses
In order to validate correct input values for IP addresses new Opt was
introduced. Validation is done on parsing level so there is no need to
explicitly check for valid ip address in the code.
Requirement for netaddr package was added.

DocImpact

Change-Id: I9adc30d9b989e8c636fefd435885c4c363ca540c
Partial-Bug: #1284684
2014-06-30 07:26:28 +01:00
David Stanek
ef6f9bc46a Refactors _Namespace to make the code clearer
The original implentation of _Namespace._get_cli_value relied on the
fact that _Namespace.default doesn't exist and accessing it would raise
an AttributeError. This attribute was being caught for another reason so
the logic just worked.

The more correct thing to do would have been to just raise a KeyError.
This change does that and removes the need to catch an AttributeErrors.

Change-Id: I963b31ea6ea8ab5180314be7cd2450395263e1af
Closes-bug: #1284968
2014-06-27 01:20:07 +00:00
Mark McLoughlin
97c6352008 Add oslo-config-generator
Add a sample config file generator utility. This is a dramatically
different approach from the generator in oslo-incubator, whereby we move
away from magic towards much more explicit control over the generator.

blueprint: oslo-config-generator
Closes-Bug: #1300546
Change-Id: I15686708fc9460948a58cfea3d18dae40ba1fda9
2014-06-26 14:20:22 +01:00
Mark McLoughlin
ab7ae99dbd Add CLI option support to config fixture
oslo.config.fixture.Config has register_opt() and register_opts() but
not register_cli_opt() and register_cli_opts().

Change-Id: I8a1582dc0deb0230eb02b0894a49398f333375fe
2014-06-25 14:00:50 +01:00
Jenkins
f18797ab7d Merge "Add warning about interpolating values from groups" 2014-06-19 19:14:56 +00:00
Jenkins
e0172be373 Merge "Add more tests for positional CLI opts" 2014-06-19 19:14:49 +00:00
OpenStack Proposal Bot
63784a0df4 Updated from global requirements
Change-Id: I4f210812d4b2df3992b8444f384839b36f807123
2014-06-19 01:12:07 +00:00
Jenkins
582e1a39a5 Merge "Add test case for hyphenated option names" 2014-06-18 19:58:15 +00:00
Jenkins
782fd6e78e Merge "Remove print statement from types.Dict" 2014-06-18 15:41:28 +00:00
Radomir Dopieralski
ec2b6044d3 Remove print statement from types.Dict
Probably left after some debugging session.

Change-Id: I8aa427b5f61f695d1c2fed016816844efeea7b8b
Closes-bug: #1331449
2014-06-18 14:42:51 +02:00
Doug Hellmann
15ea871979 Add warning about interpolating values from groups
Add a warning explaining that options in groups cannot be used with
the interpolation syntax.

Reformat note to use directive so it is highlighted.

Add "docs" section to tox.ini to make testing doc build easier.

Change-Id: If5106aa44d4c87abe84a7fb7a250541bba9f5068
2014-06-17 07:00:42 -07:00
Mark McLoughlin
25b887767b Add more tests for positional CLI opts
Add tests to ensure that e.g. default=None, default=[], etc. works
as expected.

Change-Id: I66f5df6e622a66faa1d00ee0846cbec5eb119283
2014-06-16 07:05:15 +01:00
Mark McLoughlin
6dc86f2d67 Add test case for hyphenated option names
Add some tests to show the broken behaviour in #127993 and to help
ensure that fixing it doesn't break correct behaviour in other places.

Related-Bug: #1279973
Change-Id: I69b2c4e3f27a3e193ca10cef32dd752d6a6fcc8b
2014-06-15 15:24:10 +01:00
Jenkins
1746fd2908 Merge "Bump hacking to 0.9.x series" 2014-06-14 19:10:51 +00:00
David Stanek
ee14fe0e19 Fixes an issue validating max integer values
Change-Id: I897f33df9d8faf34a4d4a69b0e351d85200e7fda
Closes-bug: #1329478
2014-06-12 20:12:45 +00:00