464 Commits

Author SHA1 Message Date
Doug Hellmann
b270375dd8 Demonstrate that MultiStr values from multiple sources are merged
Add a test to show that when we encounter the same MultiStrOption in
several sources, the values are merged into one list.

Related-Bug: #1490990
Change-Id: Ie0324572191f084a3646d8bfb1d214d14221244d
2015-09-14 18:03:50 +00:00
OpenStack Proposal Bot
7a9f4e7d67 Updated from global requirements
Change-Id: I529107e85456ea385e21a455166bc26b409da400
2015-08-31 15:35:23 +00:00
John L. Villalovos
85eee67b99 Make Integer type class honor zero for min/max
The Integer type class has an option for setting a min or max value for the
integer. But the class would not recognize zero as a valid value and not
check it.

Make the Integer class honor zero as a valid value for min and/or max.

Add test cases for using zero for min and/or max.

Change-Id: I395dea133d2a92e5ca4fab913aa17483a38f7ba1
Closes-Bug: #1489688
2015-08-27 20:38:19 -07:00
Doug Hellmann
bc13758bd6 Add sphinx extension to embed pretty descriptions of options
Add a new `show-options` directive for use in sphinx documentation to
embed the help and metadata about options in the output of the rendered
docs.

Change-Id: I549c8db98bf548dd0a7e8869a57301fa4096f78c
2015-08-22 16:58:38 +00:00
Matthew Treinish
006415f41b
Add sphinx extension to build sample config
This commit adds a sphinx extension which can be loaded in a sphinx
config.py to generate a sample config file using oslo-config-generator
during each sphinx build. This can then be incorporated into
documentation as necessary.

Co-Authored-By: Doug Hellmann <doug@doughellmann.com>
Change-Id: I2561155749fc8c6a8e31df1614ca6cdb50b4c001
2015-08-11 10:18:40 -04:00
OpenStack Proposal Bot
32e0fa2d5e Updated from global requirements
Change-Id: Id542e7006406197f04e996a4f5f3a9f34c8a12d2
2015-08-04 00:48:10 +00:00
OpenStack Proposal Bot
a91cfb5966 Updated from global requirements
Change-Id: Id2417fd358cfa83e2d5b349b1f8332065852dec3
2.2.0
2015-07-29 03:49:51 +00:00
Markus Zoeller
257de47935 preserve preformatted help text
The config options are an interface to a subset of users. These users
need to read and understand the help text of the options. To make it
easier to read, it should be possible to preformat the text. This
patch set keeps the preformat with line breaks.

Change-Id: I8aa871001f7da3cefcd9aa93992d50d0d9140157
2015-07-24 18:38:50 -05:00
Jenkins
ac505d83e4 Merge "Add enforce_type option when setting an override" 2015-07-24 18:39:53 +00:00
OpenStack Proposal Bot
f00408cb04 Updated from global requirements
Change-Id: I44d87eb466d013b2b1e298297ffd6b70eb8f3cf9
2015-07-22 04:58:53 +00:00
Jenkins
868281b41c Merge "Add regex validation to String type" 2015-07-20 22:08:33 +00:00
Chris St. Pierre
3f7b642c60 Add regex validation to String type
This lets you specify a regex that string options must match
(unanchored).

Change-Id: I0be613ee38a4752b135de5ee7f189621670d1071
2015-07-20 11:50:36 -05:00
Jenkins
1dad55fbe2 Merge "Updated from global requirements" 2015-07-18 01:31:26 +00:00
Jenkins
5af765b218 Merge "Add *.egg* to .gitignore" 2015-07-17 23:45:01 +00:00
Roxana Gherle
67c3abb048 Add enforce_type option when setting an override
The 'override' value of an option is currently stored and retrieved
with the exact value that is set through set_override method - not
taking into account the type of that option. Sometimes we want the type
of the override value to be the same as the option type and therefore
we will add an optional parameter to the set_override method that will
enforce the option value type.

Closes-Bug: #1461299
Change-Id: I008b76d3292f76d0699f0063930a3b190539740f
2015-07-17 12:50:12 -07:00
Jenkins
a7d4277fb3 Merge "Remove oslo namespace package" 2015-07-17 16:39:14 +00:00
OpenStack Proposal Bot
f9a6595d9e Updated from global requirements
Change-Id: Ia7e660253ca2ba7165a4b10f68d06bff90445f32
2015-07-17 16:16:45 +00:00
Matt Riedemann
145d0050e1 Add *.egg* to .gitignore
Change-Id: Idd3e87f2f08df8e1c32e14655cc51066b16b21d7
2015-07-17 09:09:18 -07:00
OpenStack Proposal Bot
9a1ba80ce2 Updated from global requirements
Change-Id: I790839f1a5670e0bbe530310b4ff135b76d54e53
2015-07-15 01:36:27 +00:00
Doug Hellmann
59fd48b3f0 Remove oslo namespace package
Blueprint remove-namespace-packages

Depends-on: I77e50f2f14345321d1b5319343c5872a92977936
for openstack/murano-agent
Depends-on: If51059c31c82d5235e2ae21143911b5561783ca6
for openstack/os-collect-config
Depends-on: I324ca86a21c27ce43cebf255b3c075b8fe110820
for openstack/sahara-dashboard
Depends-on: Icfc882db41883410f7b40fc5a22bfaae1a65dedc
for openstack/tempest
Depends-on: I396a64aa7610b5fcc0bab05bff442ae6b43c6164
for openstack/congress
Depends-on: I749f43bd6dc15717154475cc1a776ffd6164b7fa
for openstack/octavia
Depends-on: I892c0b64ff6bab666f1f23f5e7aeb2da088ea087
for stackforge/python-solumclient
Depends-on: I09b3bec4c68c7fe9379b3d5fefbceaa86ffe994e
for openstack/congress

Related fixes for projects that can't build for other reasons:
I7d35c85926c8f098e2e47051ff44b714478df1b7 for stackforge/magnetodb

needed for the gate:
Depends-On: I0f07858e96ea3baf46f8a453e253b9ed29c7f7e2
Depends-On: I33bd2d9dff9cb7dc1a50177db7286b7317966784

Change-Id: Ibe16f8d7f73234845cab94c8e351f41954eecb0a
2015-07-13 22:23:36 +00:00
Jenkins
cbf6b30a7b Merge "Updated from global requirements" 2015-07-13 00:31:06 +00:00
Doug Hellmann
061ab83996 Fix use of mock for 1.1.0
Correctly assert the number of calls to a mocked method.

Combine this with the change to pin the version of mock used for python
2.6 and raise the minimum version of mock used elsewhere.

Change-Id: I8cf1936f06f489561a59ec3cc75a1a8d6419a9ef
2015-07-12 19:03:45 +00:00
OpenStack Proposal Bot
858c5deeb1 Updated from global requirements
Change-Id: I79b5c1401d39311f501cd65578aa1a513eeb5013
2015-07-12 15:21:25 +00:00
Jenkins
781868f2da Merge "Expose min and max to IntOpt" 2015-07-09 18:11:55 +00:00
Jenkins
4318a1d6b0 Merge "Add FAQ entry for why we do not treat config options as API" 2015-07-08 23:46:12 +00:00
Eric Brown
366ca45ef2 Expose min and max to IntOpt
The IntOpt class utilizes the types.Integer class which has
parameters for setting the minimum and maximum value.  These min
and max values are not exposed through IntOpt and should be ideally.

In the docstring help for cfg.py, it gives an example of creating a
PortType instance of types.Integer to create a new type with a range.
Rather than projects having to define this new instance, seems better
to just expose the min and max to IntOpt.

Another advantage of adding min and max to IntOpt is the ability to
generate a useful sample config file that displays the range of
valid integer values.

Change-Id: Icce7b6799061711ea512d60facc57bf7d6f6c9cc
2015-07-07 00:12:11 -07:00
ChangBo Guo(gcb)
2576dd3eb1 Don't convert ValueError into NoSuchOptError in ConfigOpts
In method __getattr__ of ConfigOpts, we catch all exceptions and convert
it to NoSuchOptError. This is wrong, we need allow raise ValueError to
provide more details about the error.

Change-Id: Ic08b812424ff9ad79f03a9069877b610fcbd4172
Closes-Bug: #1471149
2015-07-03 16:54:10 +08:00
Jenkins
ac7c55dee3 Merge "Add tox target to find missing requirements" 2015-07-01 14:22:16 +00:00
OpenStack Proposal Bot
39bf8c5601 Updated from global requirements
Change-Id: I437bf29b89c6e3b964195f69cee929aa6eb0166a
2015-07-01 10:01:00 +00:00
Jenkins
985ac6257b Merge "Add set_default() method to fixture" 2015-07-01 09:25:51 +00:00
Jenkins
239cbdd471 Merge "Fixes example for cfg" 2015-07-01 02:38:28 +00:00
Doug Hellmann
b89f5810d7 Add FAQ entry for why we do not treat config options as API
Change-Id: I546adac6c1516a765c37101bcea3d713d528ee65
2015-06-30 22:39:35 +00:00
Doug Hellmann
427de804c3 Add set_default() method to fixture
Add a set_default() method to the fixture to allow it to be passed to
set_default() functions in other oslo libraries that expect to be given
a ConfigObj instance. This lets tests in one project use a fixture to
set defaults for options in code they don't own, and unset those
defaults when the test is cleaned up.

Change-Id: Ifa9e6e2ab4ab4f93a7dc22d786ee6fd6ae7224ae
2015-06-30 21:40:55 +00:00
Doug Hellmann
d86fd9b03f fix fixture tests for fixtures 1.3.x
The latest releases of fixtures do not allow a fixture to be cleaned up
more than once, so rewrite the fixture tests to manage the fixture by
hand and not clean it up unless that is part of the test being run.

Change-Id: I1e2aaa59e713eca231a315860ef84bc272bbe280
2015-06-30 20:25:09 +00:00
Davanum Srinivas
8e1cd36018 Add tox target to find missing requirements
Change-Id: Ib10eca3bf7813e44991634dc7ed948abbac14597
2015-06-28 11:15:22 -04:00
Jenkins
56073f066d Merge "Fix sorting of optional arguments" 2015-06-27 03:19:05 +00:00
Doug Hellmann
d4c7306eab Do not use oslo namespace for oslo.i18n lib
Release 2.0.0 of oslo.i18n drops the oslo namespace package.

Change-Id: I8303670d303b63953050c4f0ad65e1e01c567ff7
Blueprint: remove-namespace-packages
2015-06-26 17:12:56 +00:00
liyingjun
abd4a76cd0 Fixes example for cfg
`type=PortType()` should be `type=PortType` in the example of cfg module

Change-Id: I1e1449e1853fe48a280964b2b69cb2e6c283dda3
Closes-bug: #1468481
2015-06-25 19:43:58 +08:00
OpenStack Proposal Bot
b3198a77c0 Updated from global requirements
Change-Id: Ie3078b99f9d11bc9d8d04de0d55d9d929b1e46fb
2015-06-22 08:26:57 +00:00
Ilya Shakhat
40676e2c74 Fix sorting of optional arguments
When there are no positional arguments only N-1 arguments
were sorted. The original unit test covered this case, but
had no luck to catch the issue.

Closes bug 1466061

Change-Id: I54ac8d5b6b20dd42b6c49873e5b0000fe7b92057
2015-06-17 14:53:05 +03:00
Joshua Harlow
81864be008 Switch badges from 'pypip.in' to 'shields.io'
The badge hosting at 'pypip.in' has been broken for a while
now, it was supposed to be fixed in the following PR(s):

- https://github.com/badges/pypipins/issues/39
- https://github.com/badges/pypipins/issues/38
- https://github.com/badges/pypipins/issues/37

That does not appear to have actually happened and/or is not
getting addressed, so switch to a more reliable badge hosting
site that provides the same badge information.

Change-Id: I4545eabc57b5ba41102e77e143c96507cec6cf5a
2015-06-11 20:35:35 -07:00
OpenStack Proposal Bot
795c5d1592 Updated from global requirements
Change-Id: I4d0c4f72ff8677d0c6ccc5f2e7be5c81c8b33ba0
2015-06-11 00:47:43 +00:00
Jenkins
11cc8fa98b Merge "Fix typo in Opt class doc string" 2015-06-10 01:15:15 +00:00
Thomas Herve
0c9113f682 Fix sorting issue in python 3
Fix an error appear when trying to sort options when having many options
and many groups in python 3.4.

Change-Id: Iec7447e004f3708d92bd30aad94a17378fc25f31
Closes-Bug: #1463025
2015-06-08 16:26:16 +02:00
LingxianKong
a62654a4f5 Fix typo in Opt class doc string
s/iff/if

Change-Id: Ie8d7b0b2a51ebd0c8618896d0b72fda7fe923aae
2015-06-02 14:40:16 +08:00
Jenkins
02a86d2eef Merge "Document properties as properties" 2015-05-26 19:57:32 +00:00
Jamie Lennox
cc9940f91e Remove pbr requirement
Oslo.config doesn't have a runtime dependency on PBR so remove it from
requirements.

Change-Id: I2b45bbffeca22811da09fb8431fc23f6926c6595
2015-05-26 17:13:58 +10:00
Brant Knudson
5f62407025 Document properties as properties
Sphinx has a directive for python object properties (it calls them
attributes)[1]. This should be used for properties since then they
can be referenced.

[1] http://sphinx-doc.org/domains.html#directive-py:attribute

Change-Id: I8c022356f88a21f5a79f1b1c0ae6e315a76d3f3b
2015-05-25 19:56:11 -05:00
Tong Damon Da
f1f972aeb7 make registering a cli opt on a filter object work.
Change the behaviour of ConfigFilter.register_cli_opt to:

1. If the opt is already registered before parsing, then registering
just import it.
2. if the opt is not registered before, then raise an exception named

CliOptRegisteredError.
By adding this modification, the behaviour of
ConfigFilter.register_cli_opt looks more consistent to
ConfigOpts.register_cli_opt. The solution to the question mentioned in
Bug#1366946 should be like this:

from oslo_config import cfg
from oslo_config import cfgfilter

import sys

c = cfg.CONF
c.register_cli_opt(
cfg.BoolOpt('myflag',
default=False,
help='turn on myflag',
)
)
c(sys.argv[1:])

f = cfgfilter.ConfigFilter(c)
f.register_cli_opt(
cfg.BoolOpt('myflag',
default=False,
help='turn on myflag',
)
)

print f.myflag

Closes-Bug: #1366946
Change-Id: I94df9409f72807461370b4aaf8eb2543c52a89bb
2015-05-23 12:39:12 +08:00
Jenkins
a8db68bd43 Merge "Remove outdated release notes" 2015-05-17 21:48:44 +00:00