Fixing mutex

This commit is contained in:
stephb9959
2022-03-04 14:24:37 -08:00
parent 72d7f16337
commit d886876cf8

View File

@@ -69,22 +69,28 @@ namespace OpenWifi{
}
return ReturnObject(Answer);
} else if(HasParameter("applyConfiguration",Arg) && Arg=="true") {
Logger().debug(Poco::format("%: Retrieving configuration.",Existing.serialNumber));
APConfig Device(SerialNumber, Existing.deviceType, Logger(), false);
Poco::JSON::Object::Ptr Configuration;
Poco::JSON::Object ErrorsObj, WarningsObj;
ProvObjects::InventoryConfigApplyResult Results;
Logger().debug(Poco::format("%: Computing configuration.",Existing.serialNumber));
if (Device.Get(Configuration)) {
std::ostringstream OS;
Configuration->stringify(OS);
Results.appliedConfiguration = OS.str();
Poco::JSON::Object::Ptr Response;
Logger().debug(Poco::format("%: Sending configuration push.",Existing.serialNumber));
if (SDK::GW::Device::Configure(this, SerialNumber, Configuration, Response)) {
Logger().debug(Poco::format("%: Sending configuration pushed.",Existing.serialNumber));
GetRejectedLines(Response, Results.warnings);
Results.errorCode = 0;
} else {
Logger().debug(Poco::format("%: Sending configuration failed.",Existing.serialNumber));
Results.errorCode = 1;
}
} else {
Logger().debug(Poco::format("%: Configuration is bad.",Existing.serialNumber));
Results.errorCode = 1;
}
Results.to_json(Answer);