diff --git a/etcd_wrapper.py b/etcd_wrapper.py index 8559b34..ebcc291 100755 --- a/etcd_wrapper.py +++ b/etcd_wrapper.py @@ -5,6 +5,7 @@ import copy from collections import namedtuple from dataclasses import dataclass +from typing import Union PseudoEtcdMeta = namedtuple("PseudoEtcdMeta", ["key"]) @@ -23,14 +24,14 @@ class EtcdEntry: print(f"Json Error: {e}, value={value}") key: str - value: str + value: Union[str, dict] class Etcd3Wrapper(object): def __init__(self, *args, **kwargs): self.client = etcd3.client(*args, **kwargs) - def get(self, *args, value_in_json=False, **kwargs): + def get(self, *args, value_in_json=False, **kwargs) -> Union[EtcdEntry, None]: _value, _key = self.client.get(*args, **kwargs) if _key is None or _value is None: return None