Skip to content

Commit

Permalink
Support for mirror flag when syncing rpm repositories
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
vonsch committed Apr 28, 2021
1 parent 0158b85 commit 99bd3b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/212.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added mirror flag support for pulp rpm repository sync.
9 changes: 7 additions & 2 deletions pulpcore/cli/rpm/repository.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import gettext
from typing import Optional, Union
from typing import Any, Dict, Optional, Union

import click

Expand Down Expand Up @@ -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
Expand All @@ -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"]
Expand Down

0 comments on commit 99bd3b0

Please sign in to comment.