Open kript opened 6 years ago
Are you running 4.1.x here? This seems to be the issue in pre-4.2 versions where the resource associated with a data object is the root resource in the hierarchy (causes irods/irods#3419, irods/irods#3503, etc.).
The get
operation here runs a query to fetch all information in the catalog for the specified data object. The root resource of the hierarchy is stored in the resource_name
column in 4.1.
If you print out the resc_hier
instead, you can see the resource which actually stores the data object (and could use some python magic to just show the leaf resc if you want).
~Note that neither resc_hier
nor resource_name
are stored in the catalog in 4.2 (sort of), so this is a 4.1-only problem/solution.~ While this is technically true, you can still query for such information in 4.2. Sorry about that.
Thanks @jaking92 - yes we're running 4.1.10 live, and 4.1.11 in dev. I can't see resc_heir defined in the iRODS DataObject, so I'm not sure how to expose that; could you give an example?
Hmm... fair point. It would seem that resc_hier
is not part of iRODSReplica
either. The only way I can think to do this presently would be via some sort of query with DataObject.resc_hier
and the information you do have from the replicas in your example code above.
I hesitate to add a resc_hier
attribute to iRODSReplica
at this point since resource_name
is functional on 4.2+, but to your point, ils
has this info (and more). I'm going to hand off to @trel or @d-w-moore here, as they will have more-informed opinions than I do.
example script;
sample output;
equivalent
ils
output;