diff --git a/pulpcore/cli/rpm/repository.py b/pulpcore/cli/rpm/repository.py index 6ec7c392e..a475aca04 100644 --- a/pulpcore/cli/rpm/repository.py +++ b/pulpcore/cli/rpm/repository.py @@ -84,6 +84,7 @@ def repository(ctx: click.Context, pulp_ctx: PulpContext, repo_type: str) -> Non @repository.command() @click.option("--name", required=True) +@click.option("--mirror/--no-mirror", default=None) @click.option("--remote") @pass_repository_context @pass_pulp_context @@ -92,12 +93,16 @@ def sync( repository_ctx: PulpRepositoryContext, name: str, remote: Optional[str], + mirror: Optional[bool], ) -> None: repository = repository_ctx.find(name=name) repository_href = repository["pulp_href"] body = {} + if mirror: + body["mirror"] = mirror + if remote: remote_href: str = PulpRpmRemoteContext(pulp_ctx).find(name=remote)["pulp_href"] body["remote"] = remote_href