forked from pulp/pulp-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
needs_plugins with PluginRequirements PoC
[noissue]
- Loading branch information
David Davis
committed
Apr 28, 2021
1 parent
e2060bc
commit f56ba15
Showing
7 changed files
with
45 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,11 +34,11 @@ | |
RepositoryVersionDefinition = Tuple[str, str, int] # name, pulp_type, version | ||
|
||
|
||
class PluginRequiredVersion(NamedTuple): | ||
class PluginRequirement(NamedTuple): | ||
name: str | ||
min: Optional[str] = None | ||
max: Optional[str] = None | ||
feature: Optional[str] = _("this command") | ||
feature: Optional[str] = None | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mdellweg
|
||
|
||
|
||
new_component_names_to_pre_3_11_names: Dict[str, str] = dict( | ||
|
@@ -82,7 +82,7 @@ class PulpContext: | |
def __init__(self, api_kwargs: Dict[str, Any], format: str, background_tasks: bool) -> None: | ||
self._api: Optional[OpenAPI] = None | ||
self._api_kwargs = api_kwargs | ||
self._needed_plugins: List[PluginRequiredVersion] = [] | ||
self._needed_plugins: List[PluginRequirement] = [] | ||
self.isatty: bool = sys.stdout.isatty() | ||
|
||
self.format: str = format | ||
|
@@ -225,9 +225,7 @@ def needs_plugin( | |
) | ||
else: | ||
# Schedule for later checking | ||
self._needed_plugins.append( | ||
PluginRequiredVersion(name, min_version, max_version, feature) | ||
) | ||
self._needed_plugins.append(PluginRequirement(name, min_version, max_version, feature)) | ||
|
||
|
||
class PulpEntityContext: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I had to set this to None otherwise I have no idea if the value was explicitly set or not when evaluating
PluginRequirement
.