From 1b8caff3ad598744e4a0379b01fc95ca4838caa0 Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Fri, 31 Jul 2015 10:26:42 -0400 Subject: [PATCH] Fix type checks in arv-copy recursive collection copying. This is necessary follow-up from 79564b0ac7d03327cc351bbd6df544ab1f776380. API objects are now OrderedDicts instead of dicts, so `type(obj) == dict` is never true, and calling this function on an API object is a noop. No issue #. I found this after receiving a user report that arv-copy did not copy dependent collections from a pipeline template. --- sdk/python/arvados/commands/arv_copy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/python/arvados/commands/arv_copy.py b/sdk/python/arvados/commands/arv_copy.py index b68b5dccf5..c5749cce5e 100755 --- a/sdk/python/arvados/commands/arv_copy.py +++ b/sdk/python/arvados/commands/arv_copy.py @@ -329,9 +329,9 @@ def copy_collections(obj, src, dst, args): obj = arvados.util.portable_data_hash_pattern.sub(copy_collection_fn, obj) obj = arvados.util.collection_uuid_pattern.sub(copy_collection_fn, obj) return obj - elif type(obj) == dict: + elif isinstance(obj, dict): return {v: copy_collections(obj[v], src, dst, args) for v in obj} - elif type(obj) == list: + elif isinstance(obj, list): return [copy_collections(v, src, dst, args) for v in obj] return obj -- 2.30.2