mirror of
https://github.com/ohwgiles/laminar.git
synced 2024-10-27 20:34:20 +00:00
adapt nodes and tags to new folder structure
This commit is contained in:
parent
b45de55ed1
commit
9aa172e8f5
@ -371,17 +371,13 @@ bool Laminar::loadConfiguration() {
|
|||||||
|
|
||||||
if(fs::is_directory(nodeCfg)) {
|
if(fs::is_directory(nodeCfg)) {
|
||||||
for(fs::directory_iterator it(nodeCfg); it != fs::directory_iterator(); ++it) {
|
for(fs::directory_iterator it(nodeCfg); it != fs::directory_iterator(); ++it) {
|
||||||
if(!fs::is_directory(it->status()))
|
if(!fs::is_regular_file(it->status()) || it->path().extension() != ".conf")
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
fs::directory_entry config(it->path()/"config");
|
StringMap conf = parseConfFile(it->path().string().c_str());
|
||||||
if(!fs::is_regular_file(config.status()))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
StringMap conf = parseConfFile(config.path().string().c_str());
|
|
||||||
|
|
||||||
Node node;
|
Node node;
|
||||||
node.name = it->path().filename().string();
|
node.name = it->path().stem().string();
|
||||||
node.numExecutors = conf.get<int>("EXECUTORS", 6);
|
node.numExecutors = conf.get<int>("EXECUTORS", 6);
|
||||||
|
|
||||||
std::string tags = conf.get<std::string>("TAGS");
|
std::string tags = conf.get<std::string>("TAGS");
|
||||||
@ -411,14 +407,10 @@ bool Laminar::loadConfiguration() {
|
|||||||
fs::path jobsDir = fs::path(homeDir)/"cfg"/"jobs";
|
fs::path jobsDir = fs::path(homeDir)/"cfg"/"jobs";
|
||||||
if(fs::is_directory(jobsDir)) {
|
if(fs::is_directory(jobsDir)) {
|
||||||
for(fs::directory_iterator it(jobsDir); it != fs::directory_iterator(); ++it) {
|
for(fs::directory_iterator it(jobsDir); it != fs::directory_iterator(); ++it) {
|
||||||
if(fs::is_directory(it->status()))
|
if(!fs::is_regular_file(it->status()) || it->path().extension() != ".conf")
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
fs::directory_entry config(it->path()+".config");
|
StringMap conf = parseConfFile(it->path().string().c_str());
|
||||||
if(!fs::is_regular_file(config.status()))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
StringMap conf = parseConfFile(config.path().string().c_str());
|
|
||||||
|
|
||||||
std::string tags = conf.get<std::string>("TAGS");
|
std::string tags = conf.get<std::string>("TAGS");
|
||||||
if(!tags.empty()) {
|
if(!tags.empty()) {
|
||||||
@ -427,7 +419,7 @@ bool Laminar::loadConfiguration() {
|
|||||||
std::copy(std::istream_iterator<std::string>(iss),
|
std::copy(std::istream_iterator<std::string>(iss),
|
||||||
std::istream_iterator<std::string>(),
|
std::istream_iterator<std::string>(),
|
||||||
std::inserter(tagList, tagList.begin()));
|
std::inserter(tagList, tagList.begin()));
|
||||||
jobTags[it->path().filename().string()] = tagList;
|
jobTags[it->path().stem().string()] = tagList;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user