0
0
Fork 0
mirror of https://github.com/alerta/alerta.git synced 2025-01-24 09:19:40 +00:00
alerta_alerta/alerta/utils/collections.py
Nick Satterly 49ec257e76
Add attributes field to heartbeat for use in hb alerts (#1128)
* Add attributes field to heartbeat for use in hb alerts

* Whitespace fix for pre-commit hook to pass
2020-01-25 13:03:35 +01:00

12 lines
307 B
Python

def merge(dict1, dict2):
"""
Merge two dictionaries.
:param dict1:
:param dict2:
:return:
"""
for k in dict2:
if k in dict1 and isinstance(dict1[k], dict) and isinstance(dict2[k], dict):
merge(dict1[k], dict2[k])
else:
dict1[k] = dict2[k]