MCPcopy Create free account
hub / github.com/alibaba/GraphScope / _parse_config

Method _parse_config

python/graphscope/gsctl/config.py:173–195  ·  view source on GitHub ↗
(self, config_dict)

Source from the content-addressed store, hash-verified

171 self._config_file = config_file
172
173 def _parse_config(self, config_dict):
174 if not config_dict:
175 return {}, None
176
177 current_context = config_dict["current-context"]
178 if current_context is None:
179 return {}, None
180
181 contexts = {}
182 current_context_exists = False
183 for c in config_dict["contexts"]:
184 if current_context == c["name"]:
185 current_context_exists = True
186 contexts[c["name"]] = Context.from_dict(c)
187
188 if not current_context_exists:
189 raise RuntimeError(
190 "Current context {0} is not exists in config file {1}".format(
191 current_context, GS_CONFIG_DEFAULT_LOCATION
192 )
193 )
194
195 return contexts, current_context
196
197 def load_config(self):
198 config_dict = read_yaml_file(self._config_file)

Callers 1

load_configMethod · 0.95

Calls 2

from_dictMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected