Remove logging of sensitive information like the
token value from X-Auth-Token. Instead log the sha1
hash of the token value, prefixed with '{SHA1}'.
Closes-Bug: #1367339
Change-Id: I72d2ff5ca569c942aa6896aeadab489ff0097255
This commit adds valid_keys and required_keys to str2dict
and define a new function which can be used as argparse type
validator.
By this function, we can declare what fields are valid and what
fields are required for dictionary option in option definition.
Change-Id: Ib7b233e082c15d0bd6e16a754b8acad52e413986
Closes-Bug: #1102897
Certain NeutronClient CLIs require input in lower cases.
In order to allow user to provide input in a case-insensitive format,
similar to the uppercase function already existing in utils.py,
this patch adds a lowercase function.
Reference:
https://review.openstack.org/#/c/140628/16..18/neutronclient/common/utils.py
Change-Id: I3ad44a24a3a341209d3d3a033691b09d98b72e55
It is suggested to use _i18n.py per oslo.i18n document.
http://docs.openstack.org/developer/oslo.i18n/usage.html
neutronclient.i18n is now a wrapper module which emits
the derecation warning. It is because might be used in
implementation of the client extensions in other repositories.
Closes-Bug: #1519493
Change-Id: I44969daeedc9a66dd9ad5bf80617516faf245ecc
currently in neutron-lbaasv2 only upper case protocol values are
allowed for listener and pool. This patch will make protocol values
case insensitive for pool and listener.
Change-Id: I41fb7b538c81eba848b78c071edaf806663063a1
Related-Bug: #1508687
Do not surround request and response messages with newline characters
to simplify reading by robots.
Change-Id: I2efec1154cd9a327ed25b342e10d9205a22fda1c
Currently str2dict raises non user-friendly exceptions when input is not
valid:
neutron subnet-create mynetwork 10/23 --allocation-pools=10/24
# implies str2dict('10/24')
# raises:
dictionary update sequence element #0 has length 1; 2 is required
This change updates str2dict implementation in order to raise
user-friendly exceptions.
Closes-Bug: #1460336
Change-Id: Id381865e6e5d9bebcb2c984c0338126566a97c2b
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.
The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.
Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.
Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages
Change-Id: I474dcd9de166b00d02b3586858a28797e97a3231
To create a subnet, we used to require positional cidr value.
With subnetpool, cidr is now optional value. With optional
positional cidr, the cidr value cannot be parsed into known_args
if it is separated from network value.
To fix the problem, we need to find cidr value from value_specs,
and use it if we find it. Cidr is optional, may not exist.
Change-Id: Ic4bccf4e7384cc891cef71fb7ce3b52fbf997345
Closes-Bug:#1442771
In the recent commit, True/False of boolean argument
became case-insensitve and this code is copy-and-paste'ed
in several places.
Now there are several number of patches which add explicit
arguments for *-update or *-list and the code of boolean
argumetns like below will be used more than now.
This commit add a utility method to register such boolean opt.
parser.add_argument(
'--enabled',
dest='enabled', metavar='{True,False}',
choices=['True', 'true', 'False', 'false'],
help=_('Whether to enable or disable this rule.'),
default=argparse.SUPPRESS)
Change-Id: I9575eeef32154a8b92589c2cc7889803216bddb2
* all modules are using function of _ from oslo.i18n
* remove the definition of _ from openstack.common.__init__.py for safety
Change-Id: Ice2f8be1190fd13e8991a8c7fa55ca636341e875
Closes-Bug: #1382476
The following libraries have been graduated:
- gettextutils -> oslo.i18n
- jsonutils -> oslo.serialization
- strutils, timeutils -> oslo.utils
Add neutronclient.i18n module as oslo.i18n adapter.
Remove openstack.common related files completely
because neutronclient no longer use any oslo-incubator modules.
Closes-Bug: #1382017
Change-Id: Ib7ebcb691a12858049baab3b122f95bf43038f18
This patch allows us to drop our version of import_class in favor
of openstack.common.importutils version's.
Change-Id: Ia96f06e2dc7dfb9824377e3a7381da2732dd2c15
Closes-bug: 1365273
* Replace of urllib by six urlparse
* Convert dict keys into list to be able to retrieve the first element
* Use integer division for integers
* Use int instead of long in XML serialization/deserialization under Py3
Co-author: Cyril Roelandt <cyril.roelandt@enovance.com>
Change-Id: Ia79c831310775bf1c3dbec06010f8949c3a73887
This patch removes our own home brewed json helper functions and leverages
the ones from openstack.common.jsonutils instead.
Change-Id: Idc5ee0fec56b0a0f337433a830647d4f421a8283
Closes-bug: 1365263
Modifying passed arguments inadvertently is an easy pitfall in python.
Even more serious is modifying the default value to a function, since
that modification will be preserved across future function calls.
The typical defense against the latter is to avoid using mutable default
values.
This change replaces several def foo(bar=[]) with bar=() or similar, and
then fixes a few cases that were exposed where the argument was indeed
permanently modified.
Change-Id: I3d04dcb39e3816942f8e80ce499c47d774a773c6
According to the OpenStack translation policy available at
https://wiki.openstack.org/wiki/LoggingStandards debug messages
should not be translated. Like mentioned in several changes in
Nova by garyk this is to help prioritize log translation.
Change-Id: I639624cbe64749085654b32ac85596fdae577230
This change introduces the use of requests in lieu of httplib2
to ensure proper handling of SSL termination.
Implements: blueprint tls-verify
Change-Id: If182f2addf26421873b8c3d2b60f8cba9b7a9450
In Python 3, this is not a valid syntax:
def _encode_item((k, v)): ...
Pass a single parameter to the function, and start by unpacking.
Change-Id: I73743073113a4696b9adc79bdb646575794c1e2b
We don't need to have the vi modelines in each source file,
it can be set in a user's vimrc if required.
Change-Id: Ic30e91df1b0e25beda9b8d8c19be58573cdae4f6
Closes-Bug: #1229324
Using tools/check_i18n.py to scan source directory, and fix most of
the errors.
- Message internationalization
- First letter must be capital
- Using comma instead of percent in LOG.xxx
Partial-Bug: #1217100
Change-Id: I312f999f97e33d84c3f06fa1caacf32affc26a78