diff --git a/CHANGES/212.feature b/CHANGES/212.feature new file mode 100644 index 000000000..c9edcdb01 --- /dev/null +++ b/CHANGES/212.feature @@ -0,0 +1 @@ +Added mirror flag support for pulp rpm repository sync. diff --git a/pulpcore/cli/rpm/repository.py b/pulpcore/cli/rpm/repository.py index 6ec7c392e..2fdd22cff 100644 --- a/pulpcore/cli/rpm/repository.py +++ b/pulpcore/cli/rpm/repository.py @@ -1,5 +1,5 @@ import gettext -from typing import Optional, Union +from typing import Any, Dict, Optional, Union import click @@ -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,11 +93,15 @@ 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 = {} + body: Dict[str, Any] = {} + + if mirror: + body["mirror"] = mirror if remote: remote_href: str = PulpRpmRemoteContext(pulp_ctx).find(name=remote)["pulp_href"]