MCPcopy Create free account
hub / github.com/apache/trafficserver / runroot_map

Function runroot_map

src/tscore/runroot.cc:239–261  ·  view source on GitHub ↗

return a map of all path in runroot.yaml

Source from the content-addressed store, hash-verified

237
238// return a map of all path in runroot.yaml
239RunrootMapType
240runroot_map(const std::string &file)
241{
242 RunrootMapType map;
243 try {
244 YAML::Node yamlfile = YAML::LoadFile(file);
245 std::string prefix = file.substr(0, file.find_last_of('/'));
246
247 for (const auto &it : yamlfile) {
248 // key value pairs of dirs
249 std::string value = it.second.as<std::string>();
250 if (value[0] != '/') {
251 value = Layout::relative_to(prefix, value);
252 }
253 map[it.first.as<std::string>()] = value;
254 }
255 } catch (YAML::Exception &e) {
256 ink_warning("Unable to read '%s': %s", file.c_str(), e.what());
257 ink_notice("Continuing with default value");
258 return RunrootMapType{};
259 }
260 return map;
261}
262
263// check for the using of runroot
264// a map of all path will be returned

Callers 3

remove_runrootMethod · 0.85
verify_runrootMethod · 0.85
check_runrootFunction · 0.85

Calls 6

LoadFileFunction · 0.85
ink_warningFunction · 0.85
ink_noticeFunction · 0.85
substrMethod · 0.45
c_strMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected