提交 19d4d7d6 authored 作者: blu's avatar blu

cloud cmd api for platform client

上级 d664ee70
...@@ -160,6 +160,12 @@ private: ...@@ -160,6 +160,12 @@ private:
string modKey; string modKey;
string sn = m["sn"]; string sn = m["sn"];
if(sn.find('/', 0) != string::npos) {
string msg = fmt::format("evcloudsvc invalid sn({}) in module /{}/ipcs/{}/modules/{} in config: {}", sn, k, ipcIdx, mn, modIdx, v.dump());
spdlog::error(msg);
hasError = true;
break;
}
//ml //ml
if(mn == "evml") { if(mn == "evml") {
modKey = sn +":evml" + m["type"].get<string>(); modKey = sn +":evml" + m["type"].get<string>();
...@@ -223,11 +229,20 @@ private: ...@@ -223,11 +229,20 @@ private:
ret["code"] = 1; ret["code"] = 1;
ret["msg"] = msg; ret["msg"] = msg;
spdlog::error(msg); spdlog::error(msg);
hasError = true;
} }
else { else {
json &data = newConfig["data"]; json &data = newConfig["data"];
// for edge clusters, those are mgrs // for edge clusters, those are mgrs
for(auto &[k, v]: data.items()) { for(auto &[k, v]: data.items()) {
if(k.find('/', 0) != string::npos) {
ret["code"] = 2;
string msg = fmt::format("evcloudsvc invalid sn({}) as key in config: {}", k, data.dump());
ret["msg"] = msg;
spdlog::error(msg);
hasError = true;
break;
}
if(this->configMap.count(k) ^ this->peerData["config"].count(k)) { if(this->configMap.count(k) ^ this->peerData["config"].count(k)) {
spdlog::warn("evcloudsvc inconsistent configuration for cluster {}", k); spdlog::warn("evcloudsvc inconsistent configuration for cluster {}", k);
// TODO: handle this situation gracefully. // TODO: handle this situation gracefully.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论