diff --git a/pulp-glue/pulp_glue/common/context.py b/pulp-glue/pulp_glue/common/context.py index 1f9b3ba09..a27c26eed 100644 --- a/pulp-glue/pulp_glue/common/context.py +++ b/pulp-glue/pulp_glue/common/context.py @@ -240,9 +240,8 @@ 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: """ @@ -250,6 +249,7 @@ def prompt(self, text: str, hide_input: bool = False) -> str: 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.") diff --git a/pulp-glue/pulp_glue/rpm/context.py b/pulp-glue/pulp_glue/rpm/context.py index 73ff03194..b28b0af53 100644 --- a/pulp-glue/pulp_glue/rpm/context.py +++ b/pulp-glue/pulp_glue/rpm/context.py @@ -1,7 +1,5 @@ import typing as t -import click - from pulp_glue.common.context import ( EntityDefinition, PluginRequirement, @@ -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",