stephb9959
2023-03-02 09:54:00 -08:00
parent ba526f85a8
commit ba3607bd87
2 changed files with 4 additions and 16 deletions

View File

@@ -132,11 +132,10 @@ namespace OpenWifi {
if (StorageService()->InventoryDB().GetRecord("serialNumber", SerialNumber_,
D)) {
if (!D.deviceConfiguration.empty()) {
std::cout << "Adding device specific configuration: "
<< D.deviceConfiguration.size() << std::endl;
// std::cout << "Adding device specific configuration: " << D.deviceConfiguration.size() << std::endl;
AddConfiguration(D.deviceConfiguration);
} else {
std::cout << "No device specific configuration." << std::endl;
// std::cout << "No device specific configuration." << std::endl;
}
if (!D.entity.empty()) {
AddEntityConfig(D.entity);
@@ -196,8 +195,7 @@ namespace OpenWifi {
ReplaceVariablesInObject(OriginalSection, ExpandedSection);
Configuration->set(SectionName, ExpandedSection);
} else {
std::cout << " --- unknown element type --- "
<< O->get(SectionName).toString() << std::endl;
poco_warning(Logger(), fmt::format("Unknown config element type: {}",O->get(SectionName).toString()));
}
} else {
if (Explain_) {
@@ -248,8 +246,7 @@ namespace OpenWifi {
"channel",
std::strtoull(col.parameterValue.c_str(), nullptr, 10));
}
std::cout << "Setting channel in radio " << RadioIndex
<< std::endl;
// std::cout << "Setting channel in radio " << RadioIndex << std::endl;
if (Explain_) {
Poco::JSON::Object ExObj;
ExObj.set("from-name", "overrides");

View File

@@ -85,7 +85,6 @@ namespace OpenWifi {
ProvObjects::InventoryTag ExistingDevice;
auto SerialNumber = Poco::toLower(SerialNumberRaw);
if (!GetRecord("serialNumber", SerialNumber, ExistingDevice)) {
std::cout << __LINE__ << std::endl;
ProvObjects::InventoryTag NewDevice;
uint64_t Now = Utils::Now();
@@ -114,9 +113,7 @@ namespace OpenWifi {
}
}
std::cout << __LINE__ << std::endl;
if (CreateRecord(NewDevice)) {
std::cout << __LINE__ << std::endl;
SerialNumberCache()->AddSerialNumber(SerialNumber, DeviceType);
std::string FullUUID;
if (!NewDevice.entity.empty()) {
@@ -130,11 +127,9 @@ namespace OpenWifi {
if (!FullUUID.empty()) {
if (SDK::GW::Device::SetVenue(nullptr, NewDevice.serialNumber, FullUUID)) {
// std::cout << "Set GW done " << SerialNumber << std::endl;
Logger().information(Poco::format("%s: GW set entity/venue property.",
NewDevice.serialNumber));
} else {
// std::cout << "Could not set GW " << SerialNumber << std::endl;
Logger().information(Poco::format(
"%s: could not set GW entity/venue property.", NewDevice.serialNumber));
}
@@ -146,7 +141,6 @@ namespace OpenWifi {
}
} else {
// Device already exists, do we need to modify anything?
std::cout << __LINE__ << std::endl;
bool modified = false;
if (ExistingDevice.deviceType != DeviceType) {
ExistingDevice.deviceType = DeviceType;
@@ -180,13 +174,10 @@ namespace OpenWifi {
modified = true;
}
std::cout << __LINE__ << std::endl;
if (modified) {
ExistingDevice.info.modified = Utils::Now();
std::cout << __LINE__ << std::endl;
StorageService()->InventoryDB().UpdateRecord("id", ExistingDevice.info.id,
ExistingDevice);
std::cout << __LINE__ << std::endl;
}
}
return false;