StarlingX Upstream packaging
Go to file
Luan Nunes Utimura aa8ba61828 Add plugin entry point sorting mechanism in OSC
On CentOS, with `python-openstackclient` on version 4.0.0
(stable/train), the plugin entry point discovery was done by using
a built-in library called `pkg_resources` ([1], [2], [3]).

On Debian, with `python-openstackclient` on version 5.4.0-4
(stable/victoria), the discovery process is now performed by using the
`stevedore` library ([4], [5], [6]).

The problem with this replacement is that, with `stevedore`, there's no
guarantee that the plugin entry point discovery list will be the same as
it was with `pkg_resources`. That is, the fetching order of entry points
may vary from CentOS to Debian.

For plugins that just extend the existing OpenStackClient (OSC) CLI by
adding commands to it, this is fine, as the loading order doesn't
matter.

However, for custom plugins that not only add commands but also override
existing entry points configured by default plugins, this may become
a problem, because the former needs to be loaded after the latter,
otherwise, the overrides will have no effect.

Therefore, this change aims to provide a plugin entry point sorting
mechanism to keep the discovery process more consistent.

By reading plugin-specific options such as `load_first` or `load_last`
from a configuration file - that can be specified through command-line
argument (--os-osc-config-file, defaults to
/etc/openstackclient/openstackclient.conf) - the plugin entry point
sorting mechanism can decide where to insert the newly discovered
plugin: at the beginning, at the end, or where it would be inserted by
default in the list.

[1] https://opendev.org/starlingx/upstream/src/branch/master/openstack/python-openstackclient/centos/python-openstackclient.spec#L19
[2] https://opendev.org/openstack/python-openstackclient/src/branch/stable/train/openstackclient/common/clientmanager.py#L146
[3] https://opendev.org/openstack/cliff/src/branch/stable/train/cliff/commandmanager.py#L61
[4] https://opendev.org/starlingx/upstream/src/branch/master/openstack/python-openstackclient/debian/meta_data.yaml#L5
[5] https://opendev.org/openstack/python-openstackclient/src/branch/stable/victoria/openstackclient/common/clientmanager.py#L147
[6] https://opendev.org/openstack/cliff/src/branch/stable/victoria/cliff/commandmanager.py#L75

Test Plan:
PASS - Build python-openstackclient package
PASS - Build/install ISO with built package
PASS - Verify that the platform OSC has an additional argument for
       reading configuration files:
       `openstack -h | grep -- --os-osc-config file`
PASS - Verify that, when reading a configuration file with the
       `load_first` or `load_last` options (in the [plugins] section),
       the order in which the specified plugins are loaded is different

Story: 2010317
Task: 47545

Signed-off-by: Luan Nunes Utimura <LuanNunes.Utimura@windriver.com>
Change-Id: If2237bc8cef197d2a163bd7b8063dfdbb2ab1c3d
2023-03-02 18:10:15 -03:00
doc Fix tox-docs failing sphinx 2022-05-31 15:04:21 +00:00
openstack Add plugin entry point sorting mechanism in OSC 2023-03-02 18:10:15 -03:00
releasenotes Switch to newer openstackdocstheme and reno versions 2020-06-04 14:42:03 +02:00
.gitignore [Doc] Release Notes Management 2018-09-25 14:43:18 -05:00
.gitreview OpenDev Migration Patch 2019-04-19 19:52:35 +00:00
.yamllint Add .yamllint file 2021-10-14 12:50:16 +03:00
.zuul.yaml Add flake8-import-order and use python3.9 on tox 2022-06-22 21:59:14 +00:00
CONTRIBUTORS.wrs StarlingX open source release updates 2018-05-31 07:37:19 -07:00
LICENSE StarlingX open source release updates 2018-05-31 07:37:19 -07:00
README.rst StarlingX open source release updates 2018-05-31 07:37:19 -07:00
centos_build_layer.cfg Build layering, add layer build config file and srpm lst 2019-10-30 14:26:00 +08:00
centos_dev_docker_images.inc Stop building panko images 2022-03-03 19:03:57 -03:00
centos_helm.inc Infrastructure and Cluster Monitoring 2019-08-21 17:16:37 -04:00
centos_iso_image.inc remove useless clients 2020-04-03 08:19:18 +00:00
centos_pkg_dirs remove useless clients 2020-04-03 08:19:18 +00:00
centos_pkg_dirs_containers Config file changes to remove 'openstack/openstack-helm openstack/openstack-helm-infra ' after relocation to 'openstack-armada-app' 2019-09-04 15:33:15 -04:00
centos_srpms_centos.lst [PATCH 02/16] stx-upstream: upgrade python-keystone for Train 2020-04-02 06:09:30 +00:00
centos_stable_docker_images.inc Stop building panko images 2022-03-03 19:03:57 -03:00
debian_build_layer.cfg Add debian_build_layer.cfg file 2021-10-05 14:12:42 -04:00
debian_iso_image.inc Debian: upstream: update debian_iso_image.inc 2022-11-30 10:02:20 +08:00
debian_pkg_dirs Update debian_pkg_dirs 2021-11-29 13:10:06 +02:00
debian_stable_docker_images.inc Merge "Port stx-openstack images with WSGI to stx-debian" 2023-01-26 18:24:03 +00:00
debian_stable_wheels.inc Update stx-platformclients debian image 2022-11-11 17:25:05 +00:00
test-requirements.txt Fix pep8 Zuul failure 2022-11-25 13:44:16 +00:00
tox.ini Fix incomplete pop-up message on delete Action 2023-01-02 20:04:36 +00:00

README.rst

stx-upstream

StarlingX Upstream Packages