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

Function get_yaml_path

src/tscore/runroot.cc:54–79  ·  view source on GitHub ↗

the function for the checking of the yaml file in the passed in path if found return the path to the yaml file, if not return empty string.

Source from the content-addressed store, hash-verified

52// the function for the checking of the yaml file in the passed in path
53// if found return the path to the yaml file, if not return empty string.
54static std::string
55get_yaml_path(const std::string &path)
56{
57 // yaml_file 2 and 3 are for temporary use in case the change may break for people using runroot already
58 // this can be removed in the future.
59 std::string yaml_file;
60 std::string yaml_file2;
61 std::string yaml_file3;
62 if (is_directory(path.c_str())) {
63 std::string yaml_file(Layout::relative_to(path, "runroot.yaml"));
64 if (exists(yaml_file)) {
65 return yaml_file;
66 }
67 std::string yaml_file2(Layout::relative_to(path, "runroot.yml"));
68 if (exists(yaml_file2)) {
69 return yaml_file2;
70 }
71 std::string yaml_file3(Layout::relative_to(path, "runroot_path.yml"));
72 if (exists(yaml_file3)) {
73 return yaml_file3;
74 }
75 } else if (exists(path)) {
76 return path;
77 }
78 return {};
79}
80
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

Callers 4

get_parent_yaml_pathFunction · 0.85
runroot_extra_handlingFunction · 0.85
runroot_handlerFunction · 0.85

Calls 3

is_directoryFunction · 0.85
existsFunction · 0.70
c_strMethod · 0.45

Tested by

no test coverage detected