Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-156 - Added skip_types and optimize options to rpm_sync #157

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions plugins/modules/rpm_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@
required: false
default: "additive"
choices: ["additive", "mirror_complete", "mirror_content_only"]
skip_types:
description:
- List of content types to skip during sync.
type: list
required: false
default: "[]"
choices: ["srpm", "treeinfo"]
optimize:
description:
- Whether or not to optimize sync.
type: bool
required: false
default: "True"

extends_documentation_fragment:
- pulp.squeezer.pulp
author:
Expand Down Expand Up @@ -83,6 +97,15 @@ def main():
default="additive",
choices=["additive", "mirror_complete", "mirror_content_only"],
),
skip_types=dict(
type="list",
default=[],
choices=["srpm", "treeinfo"],
),
optimize=dict(
type="bool",
default=True
),
),
) as module:
remote = PulpRpmRemote(module, {"name": module.params["remote"]})
Expand All @@ -106,6 +129,18 @@ def main():
mirror = module.params["sync_policy"] == "mirror_complete"
parameters = {"mirror": mirror}

parameters = {"optimize": module.params['optimize']}

parameters.update(
{
key: module.params[key] or None
for key in [
"skip_types",
]
if module.params[key] is not None
}
)

repository.process_sync(remote, parameters)


Expand Down
Loading
Loading