From 5c34a98defeca70e3f37862f34683142f8178f3e Mon Sep 17 00:00:00 2001 From: Marios Andreou Date: Thu, 14 Oct 2021 13:22:31 +0300 Subject: [PATCH] Fix tripleo-get-hash tripleo-yum-config python installation We are now consuming this as an ansible collection but it seems we overlooked the setuptools setup.cfg install. For starters we need the ansible module paths. Added a note to get_hash doc about using --user for python setup.py install. The depends-on is needed for the failing ubi-8 build job and is not related to the change made here. Depends-On: https://review.opendev.org/c/openstack/tripleo-ci/+/814400 Change-Id: Ie5655bea08e21ce59f259832fd16cd713f90c916 --- docs/get_hash.md | 17 +++++++++++------ setup.cfg | 6 ++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/get_hash.md b/docs/get_hash.md index 7a35533..f122b21 100644 --- a/docs/get_hash.md +++ b/docs/get_hash.md @@ -22,17 +22,22 @@ try it out of the box without installation invoking it as a module: #### Install using setup.py -Installation using python setup.py requires sudo, because the python source -is installed at /usr/local/lib/python. +It is recommended to perform a user/local installation using python setup.py +to avoid the use of sudo. However you may need to set your PYTHONPATH depending +on where the python code is installed on your system. ``` -sudo python setup.py install +python setup.py install --user +tripleo-get-hash --help ``` The tripleo-get-hash utility uses a yaml configuration file named 'config.yaml'. -If you install this utility using setup.py as above, the configuration file -is placed in /usr/local/etc: +If you install this utility using --user as above, the configuration file +is placed in $HOME/.local/etc/tripleo_get_hash/config.yaml (on fedora). +If this cannot be found then the config is used directly from the source directory. +When you invoke tripleo-get-hash it will tell you which config is in use: ``` - /usr/local/etc/tripleo_get_hash/config.yaml +$ tripleo-get-hash +2021-10-15 16:22:23,724 - tripleo-get-hash - INFO - Using config file at /home/username/.local/etc/tripleo_get_hash/config.yaml ``` #### Install using pip diff --git a/setup.cfg b/setup.cfg index 8ca7fa9..2d66262 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,9 +26,15 @@ packages = tripleo_repos data_files = etc/tripleo_get_hash/ = tripleo_repos/get_hash/config.yaml + share/ansible/plugins/modules/ = plugins/modules/* + share/ansible/plugins/module_utils/ = plugins/module_utils/* [entry_points] console_scripts = tripleo-repos = tripleo_repos.main:main tripleo-yum-config = tripleo_repos.yum_config.__main__:cli_entrypoint tripleo-get-hash = tripleo_repos.get_hash.__main__:cli_entrypoint + +[pbr] +skip_authors = True +skip_changelog = True