Skip to content

Commit 7c71bd3

Browse files
committed
Add signing-service-release-overrides as an argument to repository creation
Signed-off-by: Balasankar 'Balu' C <[email protected]>
1 parent 1b8a421 commit 7c71bd3

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

pulpcore/cli/deb/repository.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ def _content_callback(ctx: click.Context, param: click.Parameter, value: Any) ->
5252
return value
5353

5454

55+
def _signing_service_callback(ctx: click.Context, param: click.Parameter, values: Any) -> Any:
56+
result: dict[str, str] = {}
57+
if not values:
58+
return result
59+
for arg in values:
60+
if "=" not in arg:
61+
raise click.BadParameter(f"must be in the format 'distribution=pulp_href', got '{arg}'")
62+
key, value = arg.split("=", 1)
63+
result[key] = value
64+
return result
65+
66+
5567
CONTENT_LIST_SCHEMA = s.Schema([{"pulp_href": str}])
5668

5769
package_options = [
@@ -133,7 +145,16 @@ def repository(ctx: click.Context, pulp_ctx: PulpCLIContext, /, repo_type: str)
133145
context_table={"deb:apt": PulpSigningServiceContext},
134146
help=_("Apt only: Signing service to use, pass in name or href"),
135147
),
136-
148+
click.option(
149+
"--signing-service-release-overrides",
150+
multiple=True,
151+
callback=_signing_service_callback,
152+
help=_(
153+
"Apt only: Override signing service to use for a distribution. "
154+
"Accepts values in distribution=pulp_href format. "
155+
"Accepts multiple such entries."
156+
),
157+
),
137158
]
138159
create_options = update_options + [click.option("--name", required=True)]
139160

0 commit comments

Comments
 (0)