@@ -264,8 +264,23 @@ def build_input_for_catalog_consumer(self):
264264 '' # confirmation of inputs
265265 ]
266266
267+ # Handle the difference between 4.3 servers and 5.x servers.
268+ if self .irods_version >= (4 , 90 , 0 ):
269+ # Always remove the element at the highest index first to reduce
270+ # complexity around indices.
271+ del input_args [14 ] # Control plane key
272+ del input_args [8 ] # Control plane port
273+ del input_args [8 ] # Schema validation base URI
274+
275+ # Insert entries for iRODS 5.x.
276+ input_args .insert (0 , '' ) # Hostname
277+
278+ # Insert entries for iRODS 4.3.
279+ input_args .insert (4 , str (self .provides_local_storage ))
280+ input_args .insert (5 , str (self .resource_name ))
281+ input_args .insert (6 , str (self .vault_directory ))
267282 # Handle the difference between 4.2 servers and 4.3 servers.
268- if self .irods_version >= (4 , 3 , 0 ):
283+ elif self .irods_version >= (4 , 3 , 0 ):
269284 input_args .insert (3 , str (self .provides_local_storage ))
270285 input_args .insert (4 , str (self .resource_name ))
271286 input_args .insert (5 , str (self .vault_directory ))
@@ -312,8 +327,24 @@ def build_input_for_catalog_provider(self):
312327 '' # confirmation of inputs
313328 ]
314329
330+ # Handle the difference between 4.3 servers and 5.x servers.
331+ if self .irods_version >= (4 , 90 , 0 ):
332+ # Remove entries that do not apply to iRODS 5.
333+ # Always remove the element at the highest index first to reduce
334+ # complexity around indices.
335+ del input_args [21 ] # Control plane key
336+ del input_args [15 ] # Control plane port
337+ del input_args [15 ] # Schema validation base URI
338+
339+ # Insert entries for iRODS 5.x.
340+ input_args .insert (0 , '' ) # Hostname
341+
342+ # Insert entries for iRODS 4.3.
343+ input_args .insert (12 , str (self .provides_local_storage ))
344+ input_args .insert (13 , str (self .resource_name ))
345+ input_args .insert (14 , str (self .vault_directory ))
315346 # Handle the difference between 4.2 servers and 4.3 servers.
316- if self .irods_version >= (4 , 3 , 0 ):
347+ elif self .irods_version >= (4 , 3 , 0 ):
317348 input_args .insert (11 , str (self .provides_local_storage ))
318349 input_args .insert (12 , str (self .resource_name ))
319350 input_args .insert (13 , str (self .vault_directory ))
0 commit comments