Description of problem: The installed `colin` command can't find its rulesets, due to the installed location not being in its search path. Version-Release number of selected component (if applicable): colin-0.5.0-3.fc35.noarch How reproducible: 100% Steps to Reproduce: 1. sudo dnf install colin 2. colin list-checks 3. colin list-rulesets Actual results: $ colin list-checks 10:53:34.549 ruleset.py WARNING Ruleset directory cannot be found. 10:53:34.549 colin.py ERROR An error occurred: ColinRulesetException('Ruleset directory cannot be found.') Error: Ruleset directory cannot be found. $ colin list-rulesets Ruleset directory cannot be found. An error occurred: ColinRulesetException('Ruleset directory cannot be found.') Error: Ruleset directory cannot be found. Expected results: colin lists the installed rulesets. Additional info: The rulesets _are_ installed (via the package python3-colin-0.5.0-3.fc35.noarch), however they're located in /usr/share/colin/, which is not one of the default search paths: $ rpm -ql python3-colin|grep -i rule |grep -v pycache /usr/lib/python3.10/site-packages/colin/core/ruleset /usr/lib/python3.10/site-packages/colin/core/ruleset/__init__.py /usr/lib/python3.10/site-packages/colin/core/ruleset/loader.py /usr/lib/python3.10/site-packages/colin/core/ruleset/ruleset.py /usr/share/colin/rulesets /usr/share/colin/rulesets/default.json /usr/share/colin/rulesets/fedora.json $ pydoc3 colin.core.ruleset.ruleset.get_ruleset_dirs|cat Help on function get_ruleset_dirs in colin.core.ruleset.ruleset: colin.core.ruleset.ruleset.get_ruleset_dirs = get_ruleset_dirs() Get the directory with ruleset files ===>First directory to check: ./rulesets <=== ===>Second directory to check: $HOME/.local/share/colin/rulesets <=== ===>Third directory to check: /usr/local/share/colin/rulesets <=== :return: str When I briefly had colin installed in my user site dir via `python3 -m pip install --force --user colin`, the default rulesets were present in `$HOME/.local/share/colin/rulesets`, and colin (even the /usr/bin/colin system install) _WAS_ able to find them. But when I removed the pip-installed package, it went right back to "Error: Ruleset directory cannot be found."
Hi Frank, thank you for the well-described bug. I will take a look at how to fix that. In the meantime, you can try using `--ruleset-file`/`-f` option and specify the next path. František
(In reply to Frantisek Lachman from comment #1) Thanks, sounds good! Looking at the code, in core/ruleset/ruleset.py you can probably replace that hardcoded `/usr/local/` on line 219 with `sys.prefix` — or add that as a fourth location to examine, if you prefer. So: import sys installed_sharedata = os.path.join(sys.prefix, RULESET_DIRECTORY) if os.path.isdir(installed_sharedata): logger.debug("Global ruleset directory found ('%s').", installed_sharedata) ruleset_dirs.append(installed_sharedata)
Thanks for the hints. Since you have looked into the code already, are you interested in contributing that change upstream? (https://github.com/user-cont/colin/) I can do that otherwise. (I am also an upstream maintainer so we can create a new fix release afterwards.) František
Hello, the problem is fixed upstream: https://github.com/user-cont/colin/pull/285 and I'm creating a new upstream release: https://github.com/user-cont/colin/pull/286 František
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle. Changing version to 36.
FEDORA-2022-10a5e6feb3 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2022-10a5e6feb3
FEDORA-2022-a96eb84ac3 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-a96eb84ac3
FEDORA-2022-5cbfa848e8 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-5cbfa848e8
FEDORA-2022-10a5e6feb3 has been pushed to the Fedora 34 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-10a5e6feb3` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-10a5e6feb3 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2022-a96eb84ac3 has been pushed to the Fedora 35 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-a96eb84ac3` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-a96eb84ac3 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2022-5cbfa848e8 has been pushed to the Fedora 36 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-5cbfa848e8` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-5cbfa848e8 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2022-10a5e6feb3 has been pushed to the Fedora 34 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2022-a96eb84ac3 has been pushed to the Fedora 35 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2022-5cbfa848e8 has been pushed to the Fedora 36 stable repository. If problem still persists, please make note of it in this bug report.