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

Function get_parent_yaml_path

src/tscore/runroot.cc:83–102  ·  view source on GitHub ↗

the function for the checking of the yaml file in passed in directory or parent directory if found return the parent path to the yaml file

Source from the content-addressed store, hash-verified

81// the function for the checking of the yaml file in passed in directory or parent directory
82// if found return the parent path to the yaml file
83static std::string
84get_parent_yaml_path(const std::string &path)
85{
86 std::string whole_path = path;
87 if (whole_path.back() == '/') {
88 whole_path.pop_back();
89 }
90 // go up to 4 level of parent directories
91 for (int i = 0; i < 4; i++) {
92 if (whole_path.empty()) {
93 return {};
94 }
95 std::string yaml_file = get_yaml_path(whole_path);
96 if (!yaml_file.empty()) {
97 return yaml_file;
98 }
99 whole_path = whole_path.substr(0, whole_path.find_last_of('/'));
100 }
101 return {};
102}
103
104static void
105runroot_extra_handling(const char *executable, bool json)

Callers 1

runroot_extra_handlingFunction · 0.85

Calls 4

get_yaml_pathFunction · 0.85
pop_backMethod · 0.80
emptyMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected