Fix misusages of ArgumentTypeError which causes a tuple of
class instance and error message string to be printed rather than just the
error message string itsself.
Change-Id: I0e997f86bb6603930cc92e90efcb48155f62ffb5
Closes-bug: #1551426
Class MultiKeyValueAction will be used to parse arguments like this:
--route destination=xxx,gateway=xxx --route destination=yyy,gateway=yyy
The result is a list like this:
[{destination:xxx, gateway:xxx}, {destination:yyy, gateway:yyy}]
This action also contain validation of the parameters.
Change-Id: Ie3aa8635c6a13fc2e429fe6922acd681dc7244cf
If “ignore” is not set under flake8 in the tox.ini
file there there are defaults set to be ignored.
The depended patch fixes many of the problems.
Change-Id: Ieed2fe1c4654e201d3fe6d40ef93e247ee736f8b
Doc: http://flake8.readthedocs.org/en/latest/config.html#default
Depends-On: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
Closes-Bug: #1548910
`dict.get()` returns `None` by default, if a key wasn't found.
Removing `None` as second argument to avoid redundancy.
Change-Id: Ia82f7469cd019509bbeccbfe54b15eeedc7bb6ea
Python’s default arguments are evaluated once when the function is defined,
not each time the function is called. This means that if you use a mutable
default argument (like list and dict) and mutate it, you will and have mutated
that object for all future calls to the function as well.
more details about this wrong usage here:
http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments
Change-Id: If187f16bfb305ac4fe6e4177e498a06c49c3f946
There are files containing string format arguments inside logging messages.
Using logging function parameters should be preferred.
Change-Id: I15b405bf4d4715263fe1e1262982467b3d4bc1f4
Closes-Bug: #1321274
Make scope check optional for the "token issue" command as unscoped token is
a valid Keystone V2/V3 API.
Change-Id: Ie1cded4dbfdafd3a78c0ebdf89e3f66762509930
Closes-Bug: #1543214
Exceptions that occur while getting network availability zones
should not be masked as if the extension does not exist.
Change-Id: I07213ec6c4d83e97261b58bf8d42417c1cdfae6a
Related-Bug: #1534202
It would be convenient to be able to enable special logging for
various components that openstack uses. The biggest thing is
the --debug prints a lot of information when often all I want to
see is the outgoing requests/responses. To get just that logged
you would put this in your clouds.yaml:
logging:
keystoneclient.session: debug
Closes-Bug: #1484660
Change-Id: I15c2607e8262f10903dd831ee8622fb5d6315310
Update the "os availability zone list" command to support listing
network availability zones along with the currently listed compute
and volume availability zones. This adds the --network option to
the command in order to only list network availability zones. By
default, all availability zones are listed. The --long option
was also updated to include a "Zone Resource" column which is
applicable to network availability zones. Example zone resources
include "network" and "router".
If the Network API does not support listing availability zones
then a warning message will be issued when the --network option
is specified.
This support requires an updated release of the SDK in order
to pull in [1].
[1] https://bugs.launchpad.net/python-openstacksdk/+bug/1532274
Change-Id: I78811d659b793d9d2111ea54665d5fe7e4887264
Closes-Bug: #1534202
As a result of the recent logging refactoring, log_method decorator
is no longer required. oslo.log provides a similar decorator
oslo_log.helpers.log_method_call. If a similar feature is needed,
we can use the decorator from oslo_log.
searchlightclient is the only OSC external plugin which uses this
decorator. The depending patch removes it, so we can safely drop
the decorator.
Change-Id: If3df09cf6aa0a401d9f89e8924adce851d0c6dec
Depends-On: Ib94e7ba77262a9a8cbfce71f3083c47cb1973364
The OpenStack SDK is now used for the network client. However,
the 'openstack quota show' command wasn't updated for the
client change. As a result, the command will fail to show
network quotas when a project name is specified. For example:
$ openstack quota show admin
'Proxy' object has no attribute 'show_quota'
This patch set fixes the command by using the OpenStack SDK
to get network quotas for a project.
Change-Id: I59a7b6780a7b80cd09e79d40d214751b25d3016e
Related-To: blueprint neutron-client
Closes-Bug: #1528249
Previously each command logs take_action parameters explicitly
by using @utils.log_method decorator or log.debug().
Some commands have no logging.
This commit calls a logger in the base class and
drops all logging definition from individual commands.
Closes-Bug: #1532294
Change-Id: I43cd0290a4353c68c075bade9571c940733da1be
Allow the exception and error status
strings to be passed in such that other plugins can
make use of this function.
There is a comment in find_resource:
The exception to catch here is dependent on which
client library the manager passed in belongs to.
Eventually this should be pulled from a common set
of client exceptions.
Since I think that is a long ways off, this change will
work now and also work when a common exception is defined
and used.
Change-Id: Iab56cd1166028caed4f1e657e0b1ee81af3f48d8
This commit makes 'log' optional.
'log' attribute of each command class does not exist
when the class is defined because 'log' is now setup
dynamically when a class is instantiated. Instead log_method
looks for a logger from a decorating method.
compute.v2.server is changed in this commit as an example.
Change-Id: Ic4d128f8e027d3b8e6f884f31369e9085c0f0871
Partial-Bug: #1532294
Update the "os availability zone list" command to support listing
volume availability zones along with the currently listed compute
availability zones. This adds a --compute and --volume option to
the command in order to select the availability zones to list. By
default, all availability zones are listed.
If the Block Storage API does not support listing availability
zones then an warning message will be issued.
Change-Id: I8159509a41bd1fb1b4e77fdbb512cf64a5ac11a9
Closes-Bug: #1532945
Refactor the "os availability zone list" command to make it a common
command instead of a compute-only command. Since availability zones
are common to compute, volume and network (new), this refactoring
allows availability zone support to be added for volume and network.
In addition to the refactor, unit and functional tests were added.
Change-Id: I63e9d41d229b21cd38e5a083493042c096d65e05
Partial-Bug: #1532945
Move the network endpoint enablement checking from the 'server create'
command to the common client manager. This allows future network
commands to use either nova or neutron networking based on the cloud
environment.
This patch set also includes related unit test enhancements to the
common client manager to trigger authentication on the tests.
Change-Id: Ia37e81d4fb05a1e2fceb3e5d367bda769ab8e64b
Related-Bug: #1519511
Related-to: blueprint neutron-client
string_to_bool() is not used by anyone.
Furthermore, it is not well designed. It tries to convirt 't', '1'
to True, which could be confused.
So remove it. If we need something similar, let's make a better one.
Change-Id: Ic1f63480c806bf7bcc9f541fc806eed297ddf718
* Change session imports to keystoneauth1
* Change keystoneclient.exception imports to keystoneauth1
* Change exceptions raised from internal API from keystoneclient to openstack.common
Change-Id: I046d89f561d6fe04baae53726f9749d2e7fe2056
A validation is necessary to check the existence of project.
This patch is similar to Ia2d8c96527820e25b074e6486d3f39c5ad7eae60.
Change-Id: Id8895ba7a21ecad05942619a82a87c0dc68eae53