This patch is exteding the specs matcher and adding support for the ">"
and "<" operators. Prior to this patch, only the "equal" forms were
supported (">=" and "<=").
It also looks inconsistent because for the "s" prefixed operators all
the 4 forms are supported already: "s<=", "s<", "s>=" and "s>".
Change-Id: I82a72b0ef6ee277e7b09b0eb138e058687ce8804
mask_dict_password method removes the keys from passed dict if those
are not
- indicative of password
- Dict
- String type
So keys with value None or other type than string/dict are being removed.
This method should just change the password with secret and return other
Key as it is without any removal or alter.
Change-Id: I21294ce6fd25a3e6438de41949d4427b17945bb2
Closes-Bug: #1600168
Now that there is a passing gate job, we can claim support for
Python 3.5 in the classifier. This patch also adds the convenience
py35 venv.
Change-Id: I96bd1ee7501905cc6a9cf9299b007dadaeac0d28
Instead of a custom build parser and evaluator for
specs use an actual formal parser and evaluation of
that parse result instead, making that custom parser
now be one that follows a more normal way of creating
and evaluating a DSL.
Also removes <all-in> operator, since it is buggy. (It
will be added later when the issue has been resolved.)
Co-authored-by: Alexis Lee <lxsli@hpe.com>
Change-Id: I10f7dff8c83e5b6983515677e80cefa55881a92c
This will ensure these methods get pulled into sphinx when
the docs are built for this object (so that people will know
that these methods exist and can be used).
Change-Id: I4e890a4830a976b4ea5fb8d5b57b03c20411df03
mask_password when given a value of:
{'ipmi_password': 'foo'} will return {'ipmi_password': '****'}
But passing the same dict to mask_dict_password() would return the dict
unchanged.
This fixes it so that it works consistently on which keys will trigger a
masking of the password.
Change-Id: I279f245fa750a57809c9d000137c4f9baf44cd40
Closes-Bug: #1594935
All the tests used a very 'strong' password of mypassword and it
wasn't apparent in reviewing some new tests whether the masking was
being done of the 'word' password in mypassword or the command option
or dictionary key.
So I've taken the liberty to rewrite all the tests with a better
password.
Change-Id: I50c05d79bc9d8eaae5147d7f96ef5abfd0f2b2e1
There's no need for checking again if next_up is not instance of
CausedByException as this is exactly what the else clause means.
Change-Id: I437b3b4948e89d6a138be03e9613e522b10d4824
QemuImgInfo is realized by parsing the output string of 'qemu-img info
**.img' line by line, it's complicated and improvment can be done. The
command 'qemu-img info **.img --output json' will produce json style
output and arguments can be parsed easily by calling json.loads. This
patch add support json format output parsing, to simplify the code and
make it more clear and readable.
Change-Id: Iefa139dc4bcea864cb86371d8a24df0e4695169c
Closes-Bug:#1590252
I have improved the readability of the code by fixing the
problems that flake8 reported.
The type of errors that are fixed are:
* H302 - Import only module
* H305 - Import not grouped correctly
* H307 - Like imports shoud be grouped together
* H402 - One line docstring needs punctation
* F821 - Undefined name
Change-Id: I3a7f12120b6a99342a3d2025206edcdc0f6a4a93
Signed-off-by: Costin Galan <cgalan@cloudbasesolutions.com>
In netaddr module, method valid_ipv4 raise exception
AddrFormatError if parameter is specified as empty string.
Method is_valid_ipv4 returns False in this case. We should
use it to avoid raising exception AddrFormatError to caller.
Change-Id: Ic983fcb7bcb9cb957333979a6604768b921e4969
Function for port validation doesn't validate "0" as a proper port
number, althought IANA RFC 6335 [1] describes as valid 0-65535.
Add missing "0" to function.
[1] https://tools.ietf.org/html/rfc6335#section-8.1.2
Change-Id: I088add52cf454e5df503ecb5d6551724fb5ddaf4
Closes-Bug: #1590485
Replaced 'except Exception' with 'netaddr.AddrFormatError' which
will be raised if address is specified as empty string.
TrivialFix
Change-Id: I3be2fb95b623f7baba057a3936b6071fb82d6a15
There is no consumer in downstream and in requirments project
file upper-constraints shows oslo.utils==3.8.0 for Mitaka branch, so
it is safe to remove it now.
Change-Id: I44ae4ce59efbfe2fd060aa0ff0e0698470d5ad36
is_valid_cidr raises TypeError if invalid addr type is passed.
Caught TypeError to return False if addr type is other than
expected.
Change-Id: I2bb6070e96eb07a47aab12eeef2840ca4f6abc1e
Closes-Bug: #1584599
Ironic needs to do some capability matching that has feature parity with
Nova's capability matching. Rather than trying to re-create it
ourselves, move Nova's matching code into oslo.utils so that we make
sure it's always the same.
Also has small modifications to handle pep8 complaints in oslo.utils,
renaming the file and test names to be more generalized, and to use
oslotest instead of nova.test.
Change-Id: I3b70afdf1479b6649feac509b794d04fc5836194