mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-01 19:17:47 +00:00
Fixing mutex
This commit is contained in:
@@ -69,22 +69,28 @@ namespace OpenWifi{
|
|||||||
}
|
}
|
||||||
return ReturnObject(Answer);
|
return ReturnObject(Answer);
|
||||||
} else if(HasParameter("applyConfiguration",Arg) && Arg=="true") {
|
} else if(HasParameter("applyConfiguration",Arg) && Arg=="true") {
|
||||||
|
Logger().debug(Poco::format("%: Retrieving configuration.",Existing.serialNumber));
|
||||||
APConfig Device(SerialNumber, Existing.deviceType, Logger(), false);
|
APConfig Device(SerialNumber, Existing.deviceType, Logger(), false);
|
||||||
Poco::JSON::Object::Ptr Configuration;
|
Poco::JSON::Object::Ptr Configuration;
|
||||||
Poco::JSON::Object ErrorsObj, WarningsObj;
|
Poco::JSON::Object ErrorsObj, WarningsObj;
|
||||||
ProvObjects::InventoryConfigApplyResult Results;
|
ProvObjects::InventoryConfigApplyResult Results;
|
||||||
|
Logger().debug(Poco::format("%: Computing configuration.",Existing.serialNumber));
|
||||||
if (Device.Get(Configuration)) {
|
if (Device.Get(Configuration)) {
|
||||||
std::ostringstream OS;
|
std::ostringstream OS;
|
||||||
Configuration->stringify(OS);
|
Configuration->stringify(OS);
|
||||||
Results.appliedConfiguration = OS.str();
|
Results.appliedConfiguration = OS.str();
|
||||||
Poco::JSON::Object::Ptr Response;
|
Poco::JSON::Object::Ptr Response;
|
||||||
|
Logger().debug(Poco::format("%: Sending configuration push.",Existing.serialNumber));
|
||||||
if (SDK::GW::Device::Configure(this, SerialNumber, Configuration, Response)) {
|
if (SDK::GW::Device::Configure(this, SerialNumber, Configuration, Response)) {
|
||||||
|
Logger().debug(Poco::format("%: Sending configuration pushed.",Existing.serialNumber));
|
||||||
GetRejectedLines(Response, Results.warnings);
|
GetRejectedLines(Response, Results.warnings);
|
||||||
Results.errorCode = 0;
|
Results.errorCode = 0;
|
||||||
} else {
|
} else {
|
||||||
|
Logger().debug(Poco::format("%: Sending configuration failed.",Existing.serialNumber));
|
||||||
Results.errorCode = 1;
|
Results.errorCode = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Logger().debug(Poco::format("%: Configuration is bad.",Existing.serialNumber));
|
||||||
Results.errorCode = 1;
|
Results.errorCode = 1;
|
||||||
}
|
}
|
||||||
Results.to_json(Answer);
|
Results.to_json(Answer);
|
||||||
|
|||||||
Reference in New Issue
Block a user