File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -850,3 +850,22 @@ def get_api_branch(branch: str) -> str:
850850def clear_cache (endpoint : pf .Platform ) -> None :
851851 """Clears the cache of an endpoint"""
852852 Portfolio .clear_cache (endpoint )
853+
854+
855+ def old_to_new_json_one (old_json : dict [str , Any ]) -> dict [str , Any ]:
856+ new_json = old_json .copy ()
857+ for key in "children" , "portfolios" :
858+ if key in new_json :
859+ new_json [key ] = old_to_new_json (new_json [key ])
860+ if "permissions" in old_json :
861+ new_json ["permissions" ] = util .perms_to_list (old_json ["permissions" ])
862+ if "branches" in old_json :
863+ new_json ["branches" ] = util .dict_to_list (old_json ["branches" ], "name" )
864+ return new_json
865+
866+
867+ def old_to_new_json (old_json : dict [str , Any ]) -> dict [str , Any ]:
868+ new_json = old_json .copy ()
869+ for k , v in new_json .items ():
870+ new_json [k ] = old_to_new_json_one (v )
871+ return util .dict_to_list (new_json , "key" )
You can’t perform that action at this time.
0 commit comments