| 33 | } |
| 34 | |
| 35 | static 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 | |
| 61 | static bool IncludeNonLocalZone(const String& zonePath, const String& package, bool& success) |
| 62 | { |
no test coverage detected