From ecea2a1fb47b6cb2a89d337390a651dfe5d415f4 Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Thu, 2 Mar 2023 09:10:29 -0800 Subject: [PATCH] https://telecominfraproject.atlassian.net/browse/WIFI-12068 Signed-off-by: stephb9959 --- src/storage/storage_inventory.cpp | 9 ++++++++- test_scripts/curl/cli | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/storage/storage_inventory.cpp b/src/storage/storage_inventory.cpp index 1e97acb..6e977ec 100644 --- a/src/storage/storage_inventory.cpp +++ b/src/storage/storage_inventory.cpp @@ -85,7 +85,8 @@ namespace OpenWifi { ProvObjects::InventoryTag ExistingDevice; auto SerialNumber = Poco::toLower(SerialNumberRaw); if (!GetRecord("serialNumber", SerialNumber, ExistingDevice)) { - ProvObjects::InventoryTag NewDevice; + std::cout << __LINE__ << std::endl; + ProvObjects::InventoryTag NewDevice; uint64_t Now = Utils::Now(); auto Tokens = Poco::StringTokenizer(ConnectionInfo, "@:"); @@ -113,7 +114,9 @@ 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()) { @@ -143,6 +146,7 @@ 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; @@ -176,10 +180,13 @@ namespace OpenWifi { modified = true; } + std::cout << __LINE__ << std::endl; if (modified) { ExistingDevice.info.modified = Utils::Now(); + std::cout << __LINE__ << std::endl; StorageService()->InventoryDB().UpdateRecord("serialNumber", SerialNumber, ExistingDevice); + std::cout << __LINE__ << std::endl; } } return false; diff --git a/test_scripts/curl/cli b/test_scripts/curl/cli index ae2f258..a45f37e 100755 --- a/test_scripts/curl/cli +++ b/test_scripts/curl/cli @@ -528,6 +528,14 @@ getvenuedevices() { jq < ${result_file} } +getvenuesperrrm() { + curl ${FLAGS} -X GET "https://${OWPROV}/api/v1/venue?RRMvendor=$1" \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer ${token}" \ + -H "Accept: application/json" > ${result_file} + jq < ${result_file} +} + listrrmalgos() { setrrm curl ${FLAGS} -X GET "http://${OWRRM}/api/v1/algorithms" \ @@ -546,6 +554,7 @@ rrmprovider() { jq < ${result_file} } + notifications() { if [[ -z "$1" ]] then @@ -664,6 +673,7 @@ case "$1" in "deleteoverride") login; deleteoverride "$2"; logout;; "venueupgraderevisions") login; venueupgraderevisions "$2"; logout;; "getsystemconfiguration") login; getsystemconfiguration "$2"; logout;; + "getvenuesperrrm") login; getvenuesperrrm "$2"; logout;; *) help ;; esac