Skip to content

Commit

Permalink
Fix stray click import in pulp-glue
Browse files Browse the repository at this point in the history
Pulp GLUE deliberately does not depend on click. For echoing status
messages, PulpContext.echo should be used.

(cherry picked from commit 156bca9)
  • Loading branch information
mdellweg committed Sep 12, 2024
1 parent b3e05b5 commit 52d8cba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pulp-glue/pulp_glue/common/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,16 @@ def echo(self, message: str, nl: bool = True, err: bool = False) -> None:
Abstract function that will be called to emit warnings and task progress.
Warning:
This function needs to be implemented.
This function does nothing until implemented by a subclass.
"""
raise NotImplementedError("PulpContext is an abstract class.")

def prompt(self, text: str, hide_input: bool = False) -> str:
"""
Abstract function that will be called to ask for a password interactively.
Note:
If a password is provided non-interactively, this function need not be implemented.
Doing so is deprecated.
"""
raise NotImplementedError("PulpContext is an abstract class.")

Expand Down
4 changes: 1 addition & 3 deletions pulp-glue/pulp_glue/rpm/context.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import typing as t

import click

from pulp_glue.common.context import (
EntityDefinition,
PluginRequirement,
Expand Down Expand Up @@ -70,7 +68,7 @@ class PulpRpmCompsXmlContext(PulpEntityContext):
def upload_comps(
self, file: t.IO[bytes], repo_href: t.Optional[str], replace: t.Optional[bool]
) -> t.Any:
click.echo(_("Uploading file {filename}").format(filename=file.name), err=True)
self.pulp_ctx.echo(_("Uploading file {filename}").format(filename=file.name), err=True)
file.seek(0)
return self.call(
"upload_comps",
Expand Down

0 comments on commit 52d8cba

Please sign in to comment.