sonic-eventd: Use json.hpp from nlohmann-json3-dev instead of swss-common (#16818)

#### Why I did it

This header file comes from an external package, and a very old version of the header file has been checked into swss-common. This will cause problems for the upcoming Bookworm upgrade.

##### Work item tracking
- Microsoft ADO **(number only)**: 25411155

#### How I did it

Change references to the header file to use the Debian package nlohmann-json-dev, instead of from swss-common.

### Tested branch (Please provide the tested image version)

- [ ] <!-- image version 1 -->
- [ ] VS image from pipeline build

Verified that eventd was running
This commit is contained in:
Saikrishna Arcot 2023-10-26 09:45:58 -07:00 committed by GitHub
parent 1fd7746855
commit b256396b48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 5 deletions

View File

@ -5,7 +5,7 @@
#include <ctime>
#include <unordered_map>
#include "rsyslog_plugin.h"
#include "json.hpp"
#include <nlohmann/json.hpp>
using json = nlohmann::json;
@ -56,7 +56,7 @@ bool RsyslogPlugin::createRegexList() {
}
try {
regexFile >> jsonList;
} catch (invalid_argument& iaException) {
} catch (nlohmann::detail::parse_error& iaException) {
SWSS_LOG_ERROR("Invalid JSON file: %s, throws exception: %s\n", m_regexPath.c_str(), iaException.what());
return false;
}
@ -83,7 +83,7 @@ bool RsyslogPlugin::createRegexList() {
rs.tag = tag;
rs.regexExpression = expression;
regexList.push_back(rs);
} catch (domain_error& deException) {
} catch (nlohmann::detail::type_error& deException) {
SWSS_LOG_ERROR("Missing required key, throws exception: %s\n", deException.what());
return false;
} catch (regex_error& reException) {

View File

@ -11,7 +11,7 @@ extern "C"
#include <vector>
#include <string>
#include <regex>
#include "json.hpp"
#include <nlohmann/json.hpp>
#include "events.h"
#include "timestamp_formatter.h"

View File

@ -9,7 +9,7 @@ extern "C"
#include <memory>
#include <regex>
#include "gtest/gtest.h"
#include "json.hpp"
#include <nlohmann/json.hpp>
#include "events.h"
#include "../rsyslog_plugin/rsyslog_plugin.h"
#include "../rsyslog_plugin/syslog_parser.h"

View File

@ -1,4 +1,5 @@
#include <thread>
#include <iostream>
#include <stdlib.h>
#include "events.h"
#include "events_common.h"