{
String zoneName = Utility::BaseName(path);
+ /* register this zone path for cluster config sync */
+ ConfigCompiler::RegisterZoneDir("_etc", path, zoneName);
+
std::vector<Expression *> expressions;
Utility::GlobRecursive(path, "*.conf", boost::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zoneName), GlobFile);
DictExpression expr(expressions);
else
ppath = Utility::DirName(GetPath()) + "/" + path;
- ZoneFragment zf;
- zf.Tag = tag;
- zf.Path = ppath;
- m_ZoneDirs[zoneName].push_back(zf);
+ RegisterZoneDir(tag, ppath, zoneName);
Utility::GlobRecursive(ppath, pattern, boost::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zoneName), GlobFile);
}
if (it == m_ZoneDirs.end())
return std::vector<ZoneFragment>();
else
- return it->second;
+ return it->second;
+}
+
+void ConfigCompiler::RegisterZoneDir(const String& tag, const String& ppath, const String& zoneName)
+{
+ ZoneFragment zf;
+ zf.Tag = tag;
+ zf.Path = ppath;
+ m_ZoneDirs[zoneName].push_back(zf);
}
+
void *GetScanner(void) const;
static std::vector<ZoneFragment> GetZoneDirs(const String& zone);
+ static void RegisterZoneDir(const String& tag, const String& ppath, const String& zoneName);
private:
boost::promise<boost::shared_ptr<Expression> > m_Promise;