def __init__(self, store_loc, store_path, delim='>'): KvStore.__init__(self, store_loc, store_path, delim) if store_loc: if ':' in store_loc: host, port = store_loc.split(':') else: host, port = store_loc, 8500 else: host, port = '127.0.0.1', 8500 self.c = Consul(host=host, port=port) self._payload = ConsulKvPayload(self.c, self._delim)
def __init__(self, store_loc, store_path, delim='>'): KvStore.__init__(self, store_loc, store_path, delim) if store_loc: if ':' not in store_loc: store_loc = store_loc + ':8500' else: store_loc = '127.0.0.1:8500' host, port = store_loc.split(':') try: self.c = Consul(host=host, port=port) self._payload = ConsulKvPayload(self.c, self._store_path, self._delim) except Exception as e: raise KvError(errno.ECONNREFUSED, "Connection refused." \ "Failed to eshtablish a new connection to consul endpoint: %s.\n %s", \ store_loc, e)
def __init__(self, store_loc, store_path, delim='>'): KvStore.__init__(self, store_loc, store_path, delim) if not os.path.exists(self._store_path): os.mkdir(self._store_path)
def __init__(self, store_loc, store_path, delim='>'): KvStore.__init__(self, store_loc, store_path, delim) if not os.path.exists(self._store_path): with open(self._store_path, 'w+') as f: pass
def __init__(self, store_loc, store_path, delim='>'): KvStore.__init__(self, store_loc, store_path, delim)
def __init__(self, store_loc, store_path, delim='>'): import json KvStore.__init__(self, store_loc, store_path, delim) if not os.path.exists(self._store_path): with open(self._store_path, 'w+') as f: json.dump({}, f, indent=2)
def __init__(self, store_loc, store_path, delim='>'): KvStore.__init__(self, store_loc, store_path, delim) self._config = configparser.ConfigParser() self._type = configparser.SectionProxy
def __init__(self, store_loc, store_path, delim='>'): KvStore.__init__(self, store_loc, store_path, delim) self._config = ConfigParser() self._config.optionxform = lambda option: option
def __init__(self, store_loc, store_path, delim='>'): KvStore.__init__(self, store_loc, store_path, delim) self.c = Consul() self._payload = ConsulKvPayload(self.c, self._delim)