From 45fcd8aeec29e7e3b86415811f2cf2a5beb82a54 Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Mon, 17 Aug 2015 17:34:09 -0400 Subject: [PATCH] 6095: Stop demoting OrderedDicts to dicts in arv-copy. History: first there was 79564b0ac7d03327cc351bbd6df544ab1f776380. This preserved the order of copied pipeline templates, but that's in part because it stopped recursing through those templates. 1b8caff3ad598744e4a0379b01fc95ca4838caa0 fixed the recursion, but then started losing the order again. This retains the order by ensuring we copy OrderedDicts as OrderedDicts. Refs #6095, #7001. --- sdk/python/arvados/commands/arv_copy.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/python/arvados/commands/arv_copy.py b/sdk/python/arvados/commands/arv_copy.py index f728b2c591..c1ee156bcc 100755 --- a/sdk/python/arvados/commands/arv_copy.py +++ b/sdk/python/arvados/commands/arv_copy.py @@ -330,9 +330,10 @@ def copy_collections(obj, src, dst, args): obj = arvados.util.collection_uuid_pattern.sub(copy_collection_fn, obj) return obj elif isinstance(obj, dict): - return {v: copy_collections(obj[v], src, dst, args) for v in obj} + return type(v)((v, copy_collections(obj[v], src, dst, args)) + for v in obj) elif isinstance(obj, list): - return [copy_collections(v, src, dst, args) for v in obj] + return type(v)(copy_collections(v, src, dst, args) for v in obj) return obj def migrate_jobspec(jobspec, src, dst, dst_repo, args): -- 2.30.2