blob: badea96a26fd710405de5c0e95952baea31d6ad6 [file] [log] [blame]
Alex0989ecf2022-03-29 13:43:21 -05001# Author: Alex Savatieiev (osavatieiev@mirantis.com; a.savex@gmail.com)
2# Copyright 2019-2022 Mirantis, Inc.
Alex3bc95f62020-03-05 17:00:04 -06003from cfg_checker.common.log import logger, logger_cli
Alex Savatieiev5118de02019-02-20 15:50:42 -06004
Alex3bc95f62020-03-05 17:00:04 -06005from cfg_checker.common.other import Utils
Alex Savatieiev5118de02019-02-20 15:50:42 -06006
7
Alex74dc1352019-05-17 13:18:24 -05008def nested_set(_d, _keys, _value):
9 # # import and deepcopy for safety
10 # from copy import deepcopy
11 # _d = deepcopy(_dict)
12 # process
13 for k in _keys[:-1]:
14 _d = _d.setdefault(k, {})
15 _d[_keys[-1]] = _value
16
17
Alex Savatieiev5118de02019-02-20 15:50:42 -060018utils = Utils()
Alex Savatieiev5118de02019-02-20 15:50:42 -060019logger = logger
20logger_cli = logger_cli