277 Commits

Author SHA1 Message Date
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
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
Davanum Srinivas
18601d3234 Bump hacking to 0.9.x series
In order to keep this patch to just a requirements bump, ignore new and
stricter hacking rules that are being triggered. Fixing up the code and
turning these on is out of scope of this patch and is for future patches.

Change-Id: I8f59083d1c0673b94fa94acb37f11a5dd0ee040d
2014-06-12 07:46:18 -04:00
Jenkins
6c283cdf55 Merge "Add a doc sample for how to use the required field" 2014-06-10 03:36:30 +00:00
OpenStack Proposal Bot
dcef87a282 Updated from global requirements
Change-Id: I21af2a9d539414f717c45dca14f7c18f2a860bf1
2014-05-28 19:19:53 +00:00
Matthew Treinish
1bcf14552d Add a doc sample for how to use the required field
This commit adds a sample to the developer documentation on setting
an option as required. Previously there was no example and it just
stated it could be done, which was a little confusing.

Change-Id: I1eb96422fd4ac8a83a5ac9397905b58fa7d6c8e0
2014-05-27 15:15:41 -04:00
Christian Berendt
8b4bf0f3e9 log: string format arguments changed to function parameters
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.

Change-Id: I22aebd928a96258c08fcaa363aed0f739825fc7e
Partial-Bug: #1321274
2014-05-20 18:42:22 +02:00
Jenkins
78c2bc95c1 Merge "Fix deprecated_opts for cli options" 2014-05-09 00:06:14 +00:00
Jenkins
bdb0814925 Merge "Updated from global requirements" 2014-05-07 17:45:12 +00:00
YAMAMOTO Takashi
68640a4d75 Fix deprecated_opts for cli options
The following simple program raises DuplicateOptError.
This commit fixes it.

oslo.config.cfg.DuplicateOptError: duplicate option: argument --bar-foo: conflicting option string(s): --bar-foo

    from oslo.config import cfg

    conf = cfg.ConfigOpts()
    oldopts = [
        cfg.DeprecatedOpt(name='oldfoo', group='oldbar'),
    ]
    conf.register_cli_opt(cfg.StrOpt(name='foo', deprecated_opts=oldopts),
                          group='bar')
    conf()

Change-Id: I022ed0236de97db42568106bc90c696732a05ef2
Closes-Bug: #1283960
2014-05-07 10:08:13 +09:00
Jenkins
a4bb2e4a1d Merge "Add section titles and fix markup of docstring" 2014-05-06 00:47:35 +00:00
Jenkins
7240ad916d Merge "Fix docstring for _Namespace._get_cli_value" 2014-05-05 20:01:20 +00:00
Jenkins
f56b38c388 Merge "Reject option names prefixed with '_'" 2014-05-05 15:46:03 +00:00
YAMAMOTO Takashi
692f00cc67 Reject option names prefixed with '_'
Such names are used for _Namespace's internal purposes.

Change-Id: I08c24f05ec3ef626b253ca3682439c1a162959e5
Related-Bug: #1284969
2014-05-02 10:08:23 +09:00
Ben Nemec
b3ed1ac24e Graduate config fixture
Adds the config fixture from incubator and the associated tests,
updating both as appropriate for the new location.

bp graduate-config-fixture

Change-Id: I5a748c3b92b26c23101a565b7ca6790b8d00ec76
2014-04-30 15:36:52 +00:00
OpenStack Proposal Bot
a55037577a Updated from global requirements
Change-Id: I2c06261c3a58ef711808a04b1639f6736c55b635
2014-04-30 02:45:43 +00:00
Cyril Roelandt
0a66c272cb Fix test_version on Python 3.4
Since Python 3.4, argparse has been printing the version on stdout rather than
on stderr as it used to. We should fix this now because:
- this is an issue when packaging oslo-config in Debian Sid, which uses Python
  3.4;
- it will be needed when Openstack switches to 3.4 anyway.

Change-Id: I6a84009acb8621d62465c4cd2573200a07b6b4ab
2014-04-25 11:15:26 +02:00
Doug Hellmann
dec5186e00 Add section titles and fix markup of docstring
Add section titles to the module docstring for cfg.py so
http://docs.openstack.org/developer/oslo.config/cfg.html is broken up
and easier to scan quickly.

Fix a couple of minor markup issues at the same time.

Change-Id: I03df6842b29e62de1b3c923218f174cf65fdefdb
2014-04-21 06:23:57 -07:00
YAMAMOTO Takashi
78225a5883 Avoid using too generic names in _Namespace
As _Namespace is used to hold key-values for user options,
avoid using conflict-prone names for internal purposes.
Namely, prefix ours with '_'.

For example, consider the following.

    conf.register_cli_opt(cfg.BoolOpt('parser'))

In this case, the option would get added to the namespace
object as a "parser" attribute, which would conflict with
the existing name in the object.

Change-Id: Ibaf8408a118e07a8a598f87ac10a91312683df40
Closes-Bug: #1284969
2014-04-15 09:35:43 +09:00
Doug Hellmann
4b8b206b44 Import run_cross_tests.sh from oslo-incubator
Change-Id: Ia97748eea46503a22767960c5b37f29f2d620db8
2014-04-03 09:05:12 -07:00
Doug Hellmann
1dc9e67290 Move py33 env before py2x
When running "tox" without specifying the environment, we want py33 to
run before py2x so testr creates its database using a format available
in both versions of python.

Change-Id: If068685116156f30a7c4fe1f3a88f1a3e1a2fe00
2014-04-01 05:12:50 -07:00
Alex Gaynor
b3475191a3 Include the 'meta' trove classifiers for python versions
Change-Id: I76caa576d9490dfbc9f405d4fb1e9ec0ded762af
2014-03-06 16:01:55 -08:00
Jenkins
a5faf6b79f Merge "Do substitution on overrides and defaults too" 2014-03-04 04:33:23 +00:00
Jenkins
58d7d2f050 Merge "Follow style guide for help strings" 2014-03-04 04:33:22 +00:00
Ben Nemec
08e54020d9 Do substitution on overrides and defaults too
Some of our consuming projects are setting defaults or overrides
on config objects that look like $state_path/some/file and we're
no longer handling that correctly since commit
2422d4118c97734067ea0b37ae159bc2e3c492c5

Change-Id: I4324bda6f3de3cdf05f8eb3cf16052c04018dec8
Closes-Bug: #1282250
2014-02-28 19:40:58 +00:00
Andreas Jaeger
bc9d3974c2 Follow style guide for help strings
Improve help strings to follow the style guide:
* Capitalize first word of each help string
* Finish help strings with "."
* Improve wording and follow usual capitalization

Change-Id: Iecab34edd35175dcf1cccd4676e5cd91752549ad
2014-02-27 08:16:48 +01:00
OpenStack Jenkins
c577365d2a Updated from global requirements
Change-Id: I09331634dc4fbc0d7bb9030eea6bb36e4db5f8e7
2014-02-26 23:33:51 +00:00
YAMAMOTO Takashi
bbfbe3578e Fix docstring for _Namespace._get_cli_value
Change-Id: Idea5f7c57c5e35f6de74bc7f2caac0ea6db35f35
2014-02-26 12:41:58 +09:00
Jenkins
53873a262c Merge "Add py33 trove classifier" 2014-02-25 16:51:47 +00:00
Jonathan LaCour
438a6a193b Convert to oslo.test
bp graduate-oslo-test

Change-Id: I7769934c2ebce46f9f364bab1a34be95f7452f49
2014-02-24 16:45:48 -08:00
YAMAMOTO Takashi
076d828efb Fix a whitespace in a comment
Change-Id: I1044f278eb0159be56d4b7564e140180c8c8441a
2014-02-24 15:45:15 +09:00
Jenkins
482e276a0b Merge "Fix docstring of parsing order" 2014-02-22 04:58:31 +00:00
Jenkins
4c5c1ea002 Merge "Remove extraneous vim configuration comments" 2014-02-18 03:11:24 +00:00
Eric Guo
e9da275906 Fix docstring of parsing order
There is wrong explaination of option parsing order in config files
and on command line. That is only the later one takes action.
The sample code shows only the later one takes action.
See http://paste.openstack.org/show/64229/

Change-Id: I4d48df1b551bb130dc25fe32303fa2d0b1fecffd
2014-02-17 14:34:32 -08:00
Dirk Mueller
13de959d20 Switch over to oslosphinx
Having the sphinx theme in the same namespace package
as the production code has been causing issues with
devstack installations. The solution settled on was
to rename oslo.sphinx to oslosphinx because oslo.sphinx
is not a "production" library.

See the linked bug report for more background details.

Closes-Bug: #1277168
Change-Id: I419fe50d66fa0c1ac48deca2286ae7c4b922d72d
2014-02-14 10:16:33 +00:00
llg8212
15007772b6 Remove extraneous vim configuration comments
Remove line containing

comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4

Change-Id: I6e486876d5743bfbfb3a93c89f6da81c32d22ffd
Closes-Bug:#1229324
2014-02-13 18:46:13 +08:00
Jenkins
2f98541d67 Merge "Support building wheels (PEP-427)" 2014-02-11 16:00:12 +00:00
Jenkins
ff5378e81d Merge "Fix misspellings in oslo.config" 2014-02-09 10:24:11 +00:00
Jenkins
2014858783 Merge "Add docs for types" 2014-02-09 10:24:11 +00:00