This commit is part of a series to retire the Packaging Deb
project. Step 2 is to remove all content from the project
repos, replacing it with a README notification where to find
ongoing work, and how to recover the repo if needed at some
future point (as in
https://docs.openstack.org/infra/manual/drivers.html#retiring-a-project).
Change-Id: Ie925a35847b69cac5762e1bba205b1a1364c21a1
Since pbr already landed and the old version of hacking seems not
work very well with pbr>=2, we should update it to match global
requirement.
Partial-Bug: #1668848
Change-Id: If4a3ac6939b1cf73cfab3c0a7bdfbf81792dc787
The H803 rule have been removed from hacking since v0.10.0.
we can remove H803 from the ignore list.
Change-Id: Ib5d6f9a223f60264976c7f9902b349a69f3f9750
Adding constraints support to libraries is slightly more complex than
services as the libraries themselves are listed in upper-constraints.txt
which leads to errors that you can't install a specific version and a
constrained version.
This change adds constraints support by also adding a helper script to
edit the constraints to remove os-apply-config.
Change-Id: I792427363cda300650d2ce1c0fdab9973be7b348
In Python 3 __ne__ by default delegates to __eq__ and inverts the
result, but in Python 2 they urge you to define __ne__ when you
define __eq__ for it to work properly [1].There are no implied
relationships among the comparison operators. The truth of x==y
does not imply that x!=y is false. Accordingly, when defining __eq__(),
one should also define __ne__() so that the operators will behave as
expected.
[1]https://docs.python.org/2/reference/datamodel.html#object.__ne__
Change-Id: I3df4396495e3404e2c644c769693f89b7c01537a
argparse was external in python 2.6 but not anymore, remove it from
requirements.
This should help with pip 8.0 that gets confused in this situation.
Installation of the external argparse is not needed.
Change-Id: Ib7e74912b36c1b5ccb514e31fac35efeff57378d
There has been recent tripleo regressions caused by heat
setting empty config as '' rather than {} which cause os-apply-config
to error on merge_configs.
This change ignores any top-level config which evaluates to False,
ignoring possible empty data including '', {}, None, []
An os-apply-config release with this fix would likely allow the current
heat pin to be removed Id134664a5df7232da0fb5d9ed62b82e12b3d54a8
Change-Id: Ia5bd99d1550f43760c064b769be3be46b3417331
Closes-Bug: #1426116
Related-Bug: #1425238
Given os-apply-config takes a JSON file as input and prints JSON-style
strings not Python ones, Booleans present an anomaly.
These are printed using `str(config)`, resulting in "True" and "False"
rather than the lowercase and JSON-compatible "true" and "false". This
patch corrects this.
There is some risk of breaking users but it should be trivial for them
to fix their scripts. As I write this, o-a-c is at 0.1.28, so we're
allowed breaking changes and I believe this is the last change required
to make all output JSON-compatible.
Change-Id: Ib41d3b01656fc7afc4911fd78ba7c1116aa9b1c9
In the past if we wanted to have a boolean key we had to evaluate the
python string representation of the key which is not necessarily very
easy in shell. This allows us to replace this code:
if [ "$(os-apply-config --key x.foo --type raw)" = "True" ] ; then
...
fi
With a much more shell friendly version:
if os-apply-config --boolean-key x.foo; then
...
fi
Change-Id: Ie88663a0028596dbd2a9c25dfc4ce54a46a63e66
If you use os-apply-config to slice out a JSON blob on the command
line you'll get back a string formatted dump of a python
dictionary (or list). Ideally we would print out proper JSON text
so that other tooling (jq, etc) can post process things in a
useful manner.
This patch updates apply_config so that if an output key is
detected to be a dict or a list it is printed to stdout
in a JSON format.
Change-Id: Ibc8b21cd6922b8664ca71e9e6009c8573ea9d107
OAC can be used to get a key from metadata by supplying EG '--key A'.
You can also extract an item from a dict, EG '--key A.B'.
However, if A is a list, there's no way to get an item out of the list.
Extend the expression language (if that's not too grand a term) to
support this. EG '--key A.0' gets the first item out of the list A.
'--key A.1.B' gets B out of the second item of list A (which must be a
dict).
Change-Id: I406cbd2d974544ed5948e137359629184d8ee156
Add keys 'uid' and 'gid' to control file. The values may be UID/GIDs or
names. In either case, the value is checked against the passwd/group
database to ensure it exists.
Change-Id: I1730a126cf024755635043b1a0f70006ab22c046
The current method of serialization for keys containing null
values in JSON input files is that they become a part of the
metadata tree, with a value expressed as the string 'None' in
output (when invoked with --key) or when inserted into templates.
The use of 'None' creates awkward ambiguity (no way for downstream
code logic to tell if the request JSON key originally contained
the string "None" or if it was actually null), and also throws
conversion errors when requested in any type other than 'raw'.
This patch proposes that keys with null values be handled as
though they were absent from the metadata completely. (If
such a key is requested in command-line invokations using "--key"
and "--key-default", the provided default will be printed.)
Change-Id: I9288dffb13d781e0c4dd9e5be0b483c090ec2d7c