Project

Profile

Help

Issue #2364

closed

Inconsistent usage of strings and constants

Added by mihai.ibanescu@gmail.com over 5 years ago. Updated about 3 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
2.10.1
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

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?

Actions #1

Updated by amacdona@redhat.com over 5 years ago

  • Triaged changed from No to Yes
Actions #2

Updated by bmbouter about 3 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.

Actions #3

Updated by bmbouter about 3 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF