MCPcopy Create free account
hub / github.com/Icinga/icinga2 / IncludeZoneDirRecursive

Function IncludeZoneDirRecursive

lib/cli/daemonutility.cpp:35–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35static bool IncludeZoneDirRecursive(const String& path, const String& package, bool& success)
36{
37 String zoneName = Utility::BaseName(path);
38
39 /* We don't have an activated zone object yet. We may forcefully guess from configitems
40 * to not include this specific synced zones directory.
41 */
42 if(!ConfigItem::GetByTypeAndName(Type::GetByName("Zone"), zoneName)) {
43 return false;
44 }
45
46 /* register this zone path for cluster config sync */
47 ConfigCompiler::RegisterZoneDir("_etc", path, zoneName);
48
49 std::vector<std::unique_ptr<Expression> > expressions;
50 Utility::GlobRecursive(path, "*.conf", [&expressions, zoneName, package](const String& file) {
51 ConfigCompiler::CollectIncludes(expressions, file, zoneName, package);
52 }, GlobFile);
53
54 DictExpression expr(std::move(expressions));
55 if (!ExecuteExpression(&expr))
56 success = false;
57
58 return true;
59}
60
61static bool IncludeNonLocalZone(const String& zonePath, const String& package, bool& success)
62{

Callers 1

ValidateConfigFilesMethod · 0.85

Calls 1

ExecuteExpressionFunction · 0.85

Tested by

no test coverage detected