Inconsistent usage of strings and constants
While reading the comments around 2190, I came across the force_full option.
I did a grep in the 2.10 branch.
I found that there is indeed a FORCE_FULL_KEYWORD = 'force_full' defined in common/pulp_rpm/common/constants.py
However, it is used exactly once outside of that file, and that is in plugins/pulp_rpm/plugins/distributors/yum/publish.py
The 'force_full' string itself is used directly in plugins/pulp_rpm/plugins/importers/yum/sync.py and in plugins/pulp_rpm/plugins/distributors/yum/configuration.py
While not a big deal, I am trying to use pulp_rpm as an example of how to write a pulp plugin, and also to update my pulp 2.7 plugins to pulp 2.10, which pulp_rpm has already done. The trials and tribulations around the relatively unstable plugin API are somewhat understandable. Inconsistency, I would hope not.
This is recent too: https://github.com/pulp/pulp_rpm/commit/df42dea8e46a1a9649727990082f5b13fbb7c6f9
If my expectation that, by defining a constant in the code, one should use it flawed, can you please provide guidance on when to use a constant vs. a string?
Updated by bmbouter over 4 years ago
- Status changed from NEW to CLOSED - WONTFIX
Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.