Fix pre-commit issues

Change-Id: Ie973475b714e01b0619acd5554a88f7da9014edc
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2023-08-30 19:22:59 +01:00
parent d889faa0cd
commit 147c01e734
6 changed files with 23 additions and 19 deletions

View File

@ -34,6 +34,8 @@ used with other data structure literals and terminate the method call with
the last argument line ending with a comma and the closing parentheses on its the last argument line ending with a comma and the closing parentheses on its
own line indented to the starting line level. own line indented to the starting line level.
.. code-block:: python
unnecessarily_long_function_name( unnecessarily_long_function_name(
'string one', 'string one',
'string two', 'string two',

View File

@ -4,8 +4,8 @@
osc-lib utilizes all of the usual OpenStack processes and requirements for osc-lib utilizes all of the usual OpenStack processes and requirements for
contributions. The code is hosted `on OpenStack's Git server`_. `Bug reports`_ contributions. The code is hosted `on OpenStack's Git server`_. `Bug reports`_
and `blueprints`_ may be submitted to the :code:`python-openstackclient` project and `blueprints`_ may be submitted to the :code:`python-openstackclient`
on `Launchpad`_. Code may be submitted to the project on `Launchpad`_. Code may be submitted to the
:code:`openstack/osc-lib` project using `Gerrit`_. :code:`openstack/osc-lib` project using `Gerrit`_.
Developers may also be found in the `IRC channel`_ ``#openstack-sdks``. Developers may also be found in the `IRC channel`_ ``#openstack-sdks``.

View File

@ -13,7 +13,8 @@ The complete list of public module name changes:
* ``openstackclient.api.auth`` -> ``osc_lib.api.auth`` * ``openstackclient.api.auth`` -> ``osc_lib.api.auth``
* ``openstackclient.api.utils`` -> ``osc_lib.api.utils`` * ``openstackclient.api.utils`` -> ``osc_lib.api.utils``
* ``openstackclient.common.command`` -> ``osc_lib.command.command`` * ``openstackclient.common.command`` -> ``osc_lib.command.command``
* ``openstackclient.common.commandmanager`` -> ``osc_lib.command.commandmanager`` * ``openstackclient.common.commandmanager`` ->
``osc_lib.command.commandmanager``
* ``openstackclient.common.exceptions`` -> ``osc_lib.exceptions`` * ``openstackclient.common.exceptions`` -> ``osc_lib.exceptions``
* ``openstackclient.common.logs`` -> ``osc_lib.logs`` * ``openstackclient.common.logs`` -> ``osc_lib.logs``
* ``openstackclient.common.parseractions`` -> ``osc_lib.cli.parseractions`` * ``openstackclient.common.parseractions`` -> ``osc_lib.cli.parseractions``
@ -26,25 +27,26 @@ Additional Changes
================== ==================
In addition to the existing public modules, other parts of OSC have been In addition to the existing public modules, other parts of OSC have been
extracted, including the base ``Command``, ``CommandManager``, ``ClientManager`` extracted, including the base ``Command``, ``CommandManager``,
and ``Session`` classes. ``ClientManager`` and ``Session`` classes.
ClientManager ClientManager
------------- -------------
The OSC ``ClientManager`` is responsible for managing all of the handles to the The OSC ``ClientManager`` is responsible for managing all of the handles to the
individual API client objects as well as coordinating session and authentication individual API client objects as well as coordinating session and
objects. authentication objects.
Plugins are encouraged to use the ClientManager interface for obtaining information Plugins are encouraged to use the ClientManager interface for obtaining
about global configuration. information about global configuration.
* ``openstackclient.common.clientmanager`` -> ``osc_lib.clientmanager`` * ``openstackclient.common.clientmanager`` -> ``osc_lib.clientmanager``
* All of the handling of the ``verify``/``insecure``/``cacert`` configuration * All of the handling of the ``verify``/``insecure``/``cacert`` configuration
options has been consolidated into ``ClientManager``. This converts the ``--verify``, options has been consolidated into ``ClientManager``. This converts the
``--insecure`` and ``--os-cacert`` options into a ``Requests``-compatible ``--verify``, ``--insecure`` and ``--os-cacert`` options into a
``verify`` attribute and a ``cacert`` attribute for the legacy client libraries. ``Requests``-compatible ``verify`` attribute and a ``cacert`` attribute for
both are now public; the ``_insecure`` attribute has been removed. the legacy client libraries. both are now public; the ``_insecure`` attribute
has been removed.
.. list-table:: Verify/Insecure/CACert .. list-table:: Verify/Insecure/CACert
:header-rows: 1 :header-rows: 1
@ -79,8 +81,8 @@ about global configuration.
- ``verify=False``, ``cacert=None`` - ``verify=False``, ``cacert=None``
* A number of other ``ClientManager`` attributes have also been made public to * A number of other ``ClientManager`` attributes have also been made public to
encourage their direct use rather than reaching in to the global options passed encourage their direct use rather than reaching in to the global options
in the ``ClientManager`` constructor: passed in the ``ClientManager`` constructor:
* ``_verify`` -> ``verify`` * ``_verify`` -> ``verify``
* ``_cacert`` -> ``cacert`` * ``_cacert`` -> ``cacert``

View File

@ -106,9 +106,9 @@ class TestListDictColumn(utils.TestCase):
col = format_columns.ListDictColumn(data) col = format_columns.ListDictColumn(data)
# we explicitly check type rather than use isinstance since an # we explicitly check type rather than use isinstance since an
# OrderedDict is a subclass of dict and would inadvertently pass # OrderedDict is a subclass of dict and would inadvertently pass
self.assertEqual(type(col.machine_readable()), list) self.assertEqual(type(col.machine_readable()), list) # noqa: H212
for x in col.machine_readable(): for x in col.machine_readable():
self.assertEqual(type(x), dict) self.assertEqual(type(x), dict) # noqa: H212
class TestSizeColumn(utils.TestCase): class TestSizeColumn(utils.TestCase):

View File

@ -47,7 +47,7 @@ fixes:
move all option special-cases into ``cli.client_config.OSC_Config``. move all option special-cases into ``cli.client_config.OSC_Config``.
Also change some private attributes to public (``region_name``, Also change some private attributes to public (``region_name``,
``interface``, ``cacert``, ``verify`` and remove ``_insecure``). ``interface``, ``cacert``, ``verify`` and remove ``_insecure``).
- Refactor ``OpenStackShell`` to handle only global argument - Refactor ``OpenStackShell`` to handle only global argument
processing and setting up the ClientManager with configuration processing and setting up the ClientManager with configuration
from ``os-client-config``. Command and plugin loading remain in from ``os-client-config``. Command and plugin loading remain in
OSC. OSC.

View File

@ -4,7 +4,7 @@ features:
Added new options `--os-service-provider`, `--os-remote-project-name`, Added new options `--os-service-provider`, `--os-remote-project-name`,
`--os-remote-project-domain-name`, `--os-remote-project-domain-id`, and `--os-remote-project-domain-name`, `--os-remote-project-domain-id`, and
`--os-remote-project-id`. These can also be loaded from their respective `--os-remote-project-id`. These can also be loaded from their respective
ENV variables (ex. `OS_SERVICE_PROVIDER` and `OS_REMOTE_PROJECT_ID`) and ENV variables (ex. `OS_SERVICE_PROVIDER` and `OS_REMOTE_PROJECT_ID`) and
allow issuing of commands to a federated cloud using keystone-to-keystone allow issuing of commands to a federated cloud using keystone-to-keystone
identity federation. More information about keystone-to-keystone can be identity federation. More information about keystone-to-keystone can be
found `here <https://specs.openstack.org/openstack/keystone-specs/specs/juno/keystone-to-keystone-federation.html>`_. found `here <https://specs.openstack.org/openstack/keystone-specs/specs/juno/keystone-to-keystone-federation.html>`_.