3232 load_string_callback ,
3333 name_option ,
3434 option_group ,
35- pass_pulp_context ,
3635 pass_repository_context ,
3736 pulp_group ,
3837 pulp_labels_option ,
4342 resource_option ,
4443 retained_versions_option ,
4544 show_command ,
45+ type_option ,
4646 update_command ,
4747 version_command ,
4848)
6868
6969
7070CONTENT_LIST_SCHEMA = s .Schema (
71- [{"name" : s .And (str , len ), "namespace" : s .And (str , len ), "version" : s .And (str , len )}]
71+ [
72+ {
73+ "name" : s .And (str , len ),
74+ "namespace" : s .And (str , len ),
75+ "version" : s .And (str , len ),
76+ }
77+ ]
7278)
7379
7480
@@ -87,20 +93,9 @@ def _signing_service_callback(ctx: click.Context, param: click.Parameter, value:
8793
8894
8995@pulp_group ()
90- @click .option (
91- "-t" ,
92- "--type" ,
93- "repo_type" ,
94- type = click .Choice (["ansible" ], case_sensitive = False ),
95- default = "ansible" ,
96- )
97- @pass_pulp_context
98- @click .pass_context
99- def repository (ctx : click .Context , pulp_ctx : PulpCLIContext , / , repo_type : str ) -> None :
100- if repo_type == "ansible" :
101- ctx .obj = PulpAnsibleRepositoryContext (pulp_ctx )
102- else :
103- raise NotImplementedError ()
96+ @type_option (choices = {"ansible" : PulpAnsibleRepositoryContext })
97+ def repository () -> None :
98+ pass
10499
105100
106101lookup_options = [href_option , name_option , repository_lookup_option ]
@@ -112,7 +107,9 @@ def repository(ctx: click.Context, pulp_ctx: PulpCLIContext, /, repo_type: str)
112107 callback = load_string_callback ,
113108 needs_plugins = [
114109 PluginRequirement (
115- "ansible" , specifier = ">=0.15.0" , feature = "gpgkeys on ansible repositories"
110+ "ansible" ,
111+ specifier = ">=0.15.0" ,
112+ feature = "gpgkeys on ansible repositories" ,
116113 )
117114 ],
118115 ),
0 commit comments