mirror of https://github.com/milvus-io/milvus.git
[skip e2e] Add new func on utils (#14993)
Signed-off-by: wangting0128 <ting.wang@zilliz.com>pull/15002/head
parent
7b3b2ba94a
commit
701105a6b6
|
@ -371,3 +371,20 @@ def get_image_tag():
|
||||||
except:
|
except:
|
||||||
print("Can not get the tag list")
|
print("Can not get the tag list")
|
||||||
return "master-latest"
|
return "master-latest"
|
||||||
|
|
||||||
|
|
||||||
|
def dict_recursive_key(_dict, key=None):
|
||||||
|
if isinstance(_dict, dict):
|
||||||
|
key_list = list(_dict.keys())
|
||||||
|
|
||||||
|
for k in key_list:
|
||||||
|
if isinstance(_dict[k], dict):
|
||||||
|
dict_recursive_key(_dict[k], key)
|
||||||
|
|
||||||
|
if key is None:
|
||||||
|
if _dict[k] is key:
|
||||||
|
del _dict[k]
|
||||||
|
else:
|
||||||
|
if _dict[k] == key:
|
||||||
|
del _dict[k]
|
||||||
|
return _dict
|
||||||
|
|
Loading…
Reference in New Issue