55from pulp_glue .common .context import (
66 EntityDefinition ,
77 EntityFieldDefinition ,
8+ PluginRequirement ,
89 PulpEntityContext ,
910 PulpRepositoryContext ,
1011)
@@ -115,6 +116,9 @@ def update(
115116
116117 distribution : EntityDefinition = distribution_ctx .entity
117118 body : EntityDefinition = {}
119+ non_blocking = base_path is None and distribution_ctx .pulp_ctx .has_plugin (
120+ PluginRequirement ("core" , specifier = ">=3.24.0" )
121+ )
118122
119123 if private is not None :
120124 body ["private" ] = private
@@ -135,16 +139,18 @@ def update(
135139 repository = t .cast (PulpEntityContext , repository )
136140 if version is not None :
137141 if distribution ["repository" ]:
138- distribution_ctx .update (body = {"repository" : "" }, non_blocking = True )
142+ distribution_ctx .update (body = {"repository" : "" }, non_blocking = non_blocking )
139143 body ["repository_version" ] = f"{ repository .pulp_href } versions/{ version } /"
140144 else :
141145 if distribution ["repository_version" ]:
142- distribution_ctx .update (body = {"repository_version" : "" }, non_blocking = True )
146+ distribution_ctx .update (
147+ body = {"repository_version" : "" }, non_blocking = non_blocking
148+ )
143149 body ["repository" ] = repository .pulp_href
144150 elif version is not None :
145151 # keep current repository, change version
146152 if distribution ["repository" ]:
147- distribution_ctx .update (body = {"repository" : "" }, non_blocking = True )
153+ distribution_ctx .update (body = {"repository" : "" }, non_blocking = non_blocking )
148154 body ["repository_version" ] = f"{ distribution ['repository' ]} versions/{ version } /"
149155 elif distribution ["repository_version" ]:
150156 # 'dummy' vars are to get us around a mypy/1.2 complaint about '_'
0 commit comments