Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
18400e61c2 |
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue