diff options
author | yayogev <yaronyogev@gmail.com> | 2018-03-21 17:31:54 +0200 |
---|---|---|
committer | yayogev <yaronyogev@gmail.com> | 2018-03-21 17:47:01 +0200 |
commit | 2e47d8704fa0fe56ced38ddb4fc94f111079bd82 (patch) | |
tree | 83e03bef41619bdce913057a08eeaf4b9be6d601 /app/utils | |
parent | 648a394f7a318443dfd82f790f83a79616c26905 (diff) |
Python 3.4 backwards compatibility (for 'verify' job)
cherry-picked from internal commit by ilia on 07/02/2018 19:49
Change-Id: I03caf42492785a9af5e8301ca202b00a7b4af787
Signed-off-by: yayogev <yaronyogev@gmail.com>
Diffstat (limited to 'app/utils')
-rw-r--r-- | app/utils/util.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/app/utils/util.py b/app/utils/util.py index 17a31c0..788eba9 100644 --- a/app/utils/util.py +++ b/app/utils/util.py @@ -9,8 +9,6 @@ ############################################################################### import importlib import signal -from argparse import Namespace -from typing import Dict, Callable import os import re @@ -129,8 +127,8 @@ def generate_object_ids(keys, obj): # and convert them to dict to enforce uniformity. # Throws a TypeError if arguments can't be converted to dict. def setup_args(args: dict, - defaults: Dict[str, object], - get_cmd_args: Callable[[], Namespace] = None): + defaults, + get_cmd_args=None): if defaults is None: defaults = {} @@ -171,3 +169,10 @@ def decode_aci_dn(object_id): def get_object_path_part(path: str, part_name: str): match = re.match(".*/{}/(.+?)/.*".format(part_name), path) return match.group(1) if match else None + + +def merge_dicts(*dicts): + result = {} + for dictionary in dicts: + result.update(dictionary) + return result |