mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
Silence compiler warnings about unused parameters
Every of these parameters exists for a reason. The best we can do is to convince the compiler.
This commit is contained in:
parent
a13751d972
commit
c791fee7c6
@ -421,7 +421,7 @@ void ConfigObject::OnAllConfigLoaded()
|
|||||||
m_Zone = ctype->GetObject(zoneName);
|
m_Zone = ctype->GetObject(zoneName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigObject::CreateChildObjects(const Type::Ptr& childType)
|
void ConfigObject::CreateChildObjects(const Type::Ptr&)
|
||||||
{
|
{
|
||||||
/* Nothing to do here. */
|
/* Nothing to do here. */
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ String Configuration::GetApiBindHost() const
|
|||||||
return Configuration::ApiBindHost;
|
return Configuration::ApiBindHost;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetApiBindHost(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetApiBindHost(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("ApiBindHost", &Configuration::ApiBindHost, val, m_ReadOnly);
|
HandleUserWrite("ApiBindHost", &Configuration::ApiBindHost, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ String Configuration::GetApiBindPort() const
|
|||||||
return Configuration::ApiBindPort;
|
return Configuration::ApiBindPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetApiBindPort(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetApiBindPort(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("ApiBindPort", &Configuration::ApiBindPort, val, m_ReadOnly);
|
HandleUserWrite("ApiBindPort", &Configuration::ApiBindPort, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ bool Configuration::GetAttachDebugger() const
|
|||||||
return Configuration::AttachDebugger;
|
return Configuration::AttachDebugger;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetAttachDebugger(bool val, bool suppress_events, const Value& cookie)
|
void Configuration::SetAttachDebugger(bool val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("AttachDebugger", &Configuration::AttachDebugger, val, m_ReadOnly);
|
HandleUserWrite("AttachDebugger", &Configuration::AttachDebugger, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ String Configuration::GetCacheDir() const
|
|||||||
return Configuration::CacheDir;
|
return Configuration::CacheDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetCacheDir(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetCacheDir(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("CacheDir", &Configuration::CacheDir, val, m_ReadOnly);
|
HandleUserWrite("CacheDir", &Configuration::CacheDir, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ int Configuration::GetConcurrency() const
|
|||||||
return Configuration::Concurrency;
|
return Configuration::Concurrency;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetConcurrency(int val, bool suppress_events, const Value& cookie)
|
void Configuration::SetConcurrency(int val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("Concurrency", &Configuration::Concurrency, val, m_ReadOnly);
|
HandleUserWrite("Concurrency", &Configuration::Concurrency, val, m_ReadOnly);
|
||||||
Configuration::ConcurrencyWasModified = true;
|
Configuration::ConcurrencyWasModified = true;
|
||||||
@ -123,7 +123,7 @@ String Configuration::GetConfigDir() const
|
|||||||
return Configuration::ConfigDir;
|
return Configuration::ConfigDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetConfigDir(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetConfigDir(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("ConfigDir", &Configuration::ConfigDir, val, m_ReadOnly);
|
HandleUserWrite("ConfigDir", &Configuration::ConfigDir, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -133,7 +133,7 @@ String Configuration::GetDataDir() const
|
|||||||
return Configuration::DataDir;
|
return Configuration::DataDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetDataDir(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetDataDir(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("DataDir", &Configuration::DataDir, val, m_ReadOnly);
|
HandleUserWrite("DataDir", &Configuration::DataDir, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ String Configuration::GetEventEngine() const
|
|||||||
return Configuration::EventEngine;
|
return Configuration::EventEngine;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetEventEngine(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetEventEngine(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("EventEngine", &Configuration::EventEngine, val, m_ReadOnly);
|
HandleUserWrite("EventEngine", &Configuration::EventEngine, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -153,7 +153,7 @@ String Configuration::GetIncludeConfDir() const
|
|||||||
return Configuration::IncludeConfDir;
|
return Configuration::IncludeConfDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetIncludeConfDir(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetIncludeConfDir(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("IncludeConfDir", &Configuration::IncludeConfDir, val, m_ReadOnly);
|
HandleUserWrite("IncludeConfDir", &Configuration::IncludeConfDir, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -163,7 +163,7 @@ String Configuration::GetInitRunDir() const
|
|||||||
return Configuration::InitRunDir;
|
return Configuration::InitRunDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetInitRunDir(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetInitRunDir(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("InitRunDir", &Configuration::InitRunDir, val, m_ReadOnly);
|
HandleUserWrite("InitRunDir", &Configuration::InitRunDir, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -173,7 +173,7 @@ String Configuration::GetLogDir() const
|
|||||||
return Configuration::LogDir;
|
return Configuration::LogDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetLogDir(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetLogDir(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("LogDir", &Configuration::LogDir, val, m_ReadOnly);
|
HandleUserWrite("LogDir", &Configuration::LogDir, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -183,7 +183,7 @@ String Configuration::GetModAttrPath() const
|
|||||||
return Configuration::ModAttrPath;
|
return Configuration::ModAttrPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetModAttrPath(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetModAttrPath(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("ModAttrPath", &Configuration::ModAttrPath, val, m_ReadOnly);
|
HandleUserWrite("ModAttrPath", &Configuration::ModAttrPath, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -193,7 +193,7 @@ String Configuration::GetObjectsPath() const
|
|||||||
return Configuration::ObjectsPath;
|
return Configuration::ObjectsPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetObjectsPath(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetObjectsPath(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("ObjectsPath", &Configuration::ObjectsPath, val, m_ReadOnly);
|
HandleUserWrite("ObjectsPath", &Configuration::ObjectsPath, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -203,7 +203,7 @@ String Configuration::GetPidPath() const
|
|||||||
return Configuration::PidPath;
|
return Configuration::PidPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetPidPath(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetPidPath(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("PidPath", &Configuration::PidPath, val, m_ReadOnly);
|
HandleUserWrite("PidPath", &Configuration::PidPath, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ String Configuration::GetPkgDataDir() const
|
|||||||
return Configuration::PkgDataDir;
|
return Configuration::PkgDataDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetPkgDataDir(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetPkgDataDir(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("PkgDataDir", &Configuration::PkgDataDir, val, m_ReadOnly);
|
HandleUserWrite("PkgDataDir", &Configuration::PkgDataDir, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -223,7 +223,7 @@ String Configuration::GetPrefixDir() const
|
|||||||
return Configuration::PrefixDir;
|
return Configuration::PrefixDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetPrefixDir(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetPrefixDir(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("PrefixDir", &Configuration::PrefixDir, val, m_ReadOnly);
|
HandleUserWrite("PrefixDir", &Configuration::PrefixDir, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -233,7 +233,7 @@ String Configuration::GetProgramData() const
|
|||||||
return Configuration::ProgramData;
|
return Configuration::ProgramData;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetProgramData(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetProgramData(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("ProgramData", &Configuration::ProgramData, val, m_ReadOnly);
|
HandleUserWrite("ProgramData", &Configuration::ProgramData, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -243,7 +243,7 @@ int Configuration::GetRLimitFiles() const
|
|||||||
return Configuration::RLimitFiles;
|
return Configuration::RLimitFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetRLimitFiles(int val, bool suppress_events, const Value& cookie)
|
void Configuration::SetRLimitFiles(int val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("RLimitFiles", &Configuration::RLimitFiles, val, m_ReadOnly);
|
HandleUserWrite("RLimitFiles", &Configuration::RLimitFiles, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -253,7 +253,7 @@ int Configuration::GetRLimitProcesses() const
|
|||||||
return RLimitProcesses;
|
return RLimitProcesses;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetRLimitProcesses(int val, bool suppress_events, const Value& cookie)
|
void Configuration::SetRLimitProcesses(int val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("RLimitProcesses", &Configuration::RLimitProcesses, val, m_ReadOnly);
|
HandleUserWrite("RLimitProcesses", &Configuration::RLimitProcesses, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -263,7 +263,7 @@ int Configuration::GetRLimitStack() const
|
|||||||
return Configuration::RLimitStack;
|
return Configuration::RLimitStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetRLimitStack(int val, bool suppress_events, const Value& cookie)
|
void Configuration::SetRLimitStack(int val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("RLimitStack", &Configuration::RLimitStack, val, m_ReadOnly);
|
HandleUserWrite("RLimitStack", &Configuration::RLimitStack, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -273,7 +273,7 @@ String Configuration::GetRunAsGroup() const
|
|||||||
return Configuration::RunAsGroup;
|
return Configuration::RunAsGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetRunAsGroup(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetRunAsGroup(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("RunAsGroup", &Configuration::RunAsGroup, val, m_ReadOnly);
|
HandleUserWrite("RunAsGroup", &Configuration::RunAsGroup, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -283,7 +283,7 @@ String Configuration::GetRunAsUser() const
|
|||||||
return Configuration::RunAsUser;
|
return Configuration::RunAsUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetRunAsUser(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetRunAsUser(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("RunAsUser", &Configuration::RunAsUser, val, m_ReadOnly);
|
HandleUserWrite("RunAsUser", &Configuration::RunAsUser, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -293,7 +293,7 @@ String Configuration::GetSpoolDir() const
|
|||||||
return Configuration::SpoolDir;
|
return Configuration::SpoolDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetSpoolDir(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetSpoolDir(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("SpoolDir", &Configuration::SpoolDir, val, m_ReadOnly);
|
HandleUserWrite("SpoolDir", &Configuration::SpoolDir, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -303,7 +303,7 @@ String Configuration::GetStatePath() const
|
|||||||
return Configuration::StatePath;
|
return Configuration::StatePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetStatePath(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetStatePath(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("StatePath", &Configuration::StatePath, val, m_ReadOnly);
|
HandleUserWrite("StatePath", &Configuration::StatePath, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -313,7 +313,7 @@ double Configuration::GetTlsHandshakeTimeout() const
|
|||||||
return Configuration::TlsHandshakeTimeout;
|
return Configuration::TlsHandshakeTimeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetTlsHandshakeTimeout(double val, bool suppress_events, const Value& cookie)
|
void Configuration::SetTlsHandshakeTimeout(double val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("TlsHandshakeTimeout", &Configuration::TlsHandshakeTimeout, val, m_ReadOnly);
|
HandleUserWrite("TlsHandshakeTimeout", &Configuration::TlsHandshakeTimeout, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -323,7 +323,7 @@ String Configuration::GetVarsPath() const
|
|||||||
return Configuration::VarsPath;
|
return Configuration::VarsPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetVarsPath(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetVarsPath(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("VarsPath", &Configuration::VarsPath, val, m_ReadOnly);
|
HandleUserWrite("VarsPath", &Configuration::VarsPath, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -333,7 +333,7 @@ String Configuration::GetZonesDir() const
|
|||||||
return Configuration::ZonesDir;
|
return Configuration::ZonesDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetZonesDir(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetZonesDir(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("ZonesDir", &Configuration::ZonesDir, val, m_ReadOnly);
|
HandleUserWrite("ZonesDir", &Configuration::ZonesDir, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -343,7 +343,7 @@ String Configuration::GetLocalStateDir() const
|
|||||||
return Configuration::LocalStateDir;
|
return Configuration::LocalStateDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetLocalStateDir(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetLocalStateDir(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("LocalStateDir", &Configuration::LocalStateDir, val, m_ReadOnly);
|
HandleUserWrite("LocalStateDir", &Configuration::LocalStateDir, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -353,7 +353,7 @@ String Configuration::GetSysconfDir() const
|
|||||||
return Configuration::SysconfDir;
|
return Configuration::SysconfDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetSysconfDir(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetSysconfDir(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("SysconfDir", &Configuration::SysconfDir, val, m_ReadOnly);
|
HandleUserWrite("SysconfDir", &Configuration::SysconfDir, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
@ -363,7 +363,7 @@ String Configuration::GetRunDir() const
|
|||||||
return Configuration::RunDir;
|
return Configuration::RunDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::SetRunDir(const String& val, bool suppress_events, const Value& cookie)
|
void Configuration::SetRunDir(const String& val, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
HandleUserWrite("RunDir", &Configuration::RunDir, val, m_ReadOnly);
|
HandleUserWrite("RunDir", &Configuration::RunDir, val, m_ReadOnly);
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ IoEngine::IoEngine() : m_IoContext(), m_KeepAlive(boost::asio::make_work_guard(m
|
|||||||
|
|
||||||
IoEngine::~IoEngine()
|
IoEngine::~IoEngine()
|
||||||
{
|
{
|
||||||
for (auto& thread : m_Threads) {
|
for ([[maybe_unused]] auto& thread : m_Threads) {
|
||||||
boost::asio::post(m_IoContext, []() {
|
boost::asio::post(m_IoContext, []() {
|
||||||
throw TerminateIoThread();
|
throw TerminateIoThread();
|
||||||
});
|
});
|
||||||
|
@ -125,7 +125,7 @@ Value Object::GetFieldByName(const String& field, bool sandboxed, const DebugInf
|
|||||||
return GetField(fid);
|
return GetField(fid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object::SetFieldByName(const String& field, const Value& value, bool overrideFrozen, const DebugInfo& debugInfo)
|
void Object::SetFieldByName(const String& field, const Value& value, [[maybe_unused]] bool overrideFrozen, const DebugInfo& debugInfo)
|
||||||
{
|
{
|
||||||
Type::Ptr type = GetReflectionType();
|
Type::Ptr type = GetReflectionType();
|
||||||
|
|
||||||
@ -150,22 +150,22 @@ void Object::SetFieldByName(const String& field, const Value& value, bool overri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object::Validate(int types, const ValidationUtils& utils)
|
void Object::Validate([[maybe_unused]] int types, const ValidationUtils&)
|
||||||
{
|
{
|
||||||
/* Nothing to do here. */
|
/* Nothing to do here. */
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object::ValidateField(int id, const Lazy<Value>& lvalue, const ValidationUtils& utils)
|
void Object::ValidateField([[maybe_unused]] int id, const Lazy<Value>&, const ValidationUtils&)
|
||||||
{
|
{
|
||||||
/* Nothing to do here. */
|
/* Nothing to do here. */
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object::NotifyField(int id, const Value& cookie)
|
void Object::NotifyField([[maybe_unused]] int id, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
BOOST_THROW_EXCEPTION(std::runtime_error("Invalid field ID."));
|
BOOST_THROW_EXCEPTION(std::runtime_error("Invalid field ID."));
|
||||||
}
|
}
|
||||||
|
|
||||||
Object::Ptr Object::NavigateField(int id) const
|
Object::Ptr Object::NavigateField([[maybe_unused]] int id) const
|
||||||
{
|
{
|
||||||
BOOST_THROW_EXCEPTION(std::runtime_error("Invalid field ID."));
|
BOOST_THROW_EXCEPTION(std::runtime_error("Invalid field ID."));
|
||||||
}
|
}
|
||||||
|
@ -500,9 +500,9 @@ void ScriptUtils::Assert(const Value& arg)
|
|||||||
BOOST_THROW_EXCEPTION(std::runtime_error("Assertion failed"));
|
BOOST_THROW_EXCEPTION(std::runtime_error("Assertion failed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
String ScriptUtils::MsiGetComponentPathShim(const String& component)
|
String ScriptUtils::MsiGetComponentPathShim(const String& component)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
|
||||||
TCHAR productCode[39];
|
TCHAR productCode[39];
|
||||||
if (MsiGetProductCode(component.CStr(), productCode) != ERROR_SUCCESS)
|
if (MsiGetProductCode(component.CStr(), productCode) != ERROR_SUCCESS)
|
||||||
return "";
|
return "";
|
||||||
@ -511,10 +511,13 @@ String ScriptUtils::MsiGetComponentPathShim(const String& component)
|
|||||||
path[0] = '\0';
|
path[0] = '\0';
|
||||||
MsiGetComponentPath(productCode, component.CStr(), path, &szPath);
|
MsiGetComponentPath(productCode, component.CStr(), path, &szPath);
|
||||||
return path;
|
return path;
|
||||||
#else /* _WIN32 */
|
|
||||||
return String();
|
|
||||||
#endif /* _WIN32 */
|
|
||||||
}
|
}
|
||||||
|
#else /* _WIN32 */
|
||||||
|
String ScriptUtils::MsiGetComponentPathShim([[maybe_unused]] const String& component)
|
||||||
|
{
|
||||||
|
return String();
|
||||||
|
}
|
||||||
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
double ScriptUtils::Ptr(const Object::Ptr& object)
|
double ScriptUtils::Ptr(const Object::Ptr& object)
|
||||||
{
|
{
|
||||||
|
@ -202,7 +202,7 @@ int Type::GetActivationPriority() const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Type::RegisterAttributeHandler(int fieldId, const AttributeHandler& callback)
|
void Type::RegisterAttributeHandler([[maybe_unused]] int fieldId, const AttributeHandler&)
|
||||||
{
|
{
|
||||||
throw std::runtime_error("Invalid field ID.");
|
throw std::runtime_error("Invalid field ID.");
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ static void TypeRegisterAttributeHandler(const String& fieldName, const Function
|
|||||||
REQUIRE_NOT_NULL(self);
|
REQUIRE_NOT_NULL(self);
|
||||||
|
|
||||||
int fid = self->GetFieldId(fieldName);
|
int fid = self->GetFieldId(fieldName);
|
||||||
self->RegisterAttributeHandler(fid, [callback](const Object::Ptr& object, const Value& cookie) {
|
self->RegisterAttributeHandler(fid, [callback](const Object::Ptr& object, [[maybe_unused]] const Value& cookie) {
|
||||||
callback->Invoke({ object });
|
callback->Invoke({ object });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -430,7 +430,7 @@ static bool GlobHelper(const String& pathSpec, int type, std::vector<String>& fi
|
|||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
static int GlobErrorHandler(const char *epath, int eerrno)
|
static int GlobErrorHandler([[maybe_unused]] const char *epath, int eerrno)
|
||||||
{
|
{
|
||||||
if (eerrno == ENOTDIR)
|
if (eerrno == ENOTDIR)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -28,7 +28,7 @@ ImpersonationLevel ApiSetupCommand::GetImpersonationLevel() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ApiSetupCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
void ApiSetupCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
||||||
boost::program_options::options_description& hiddenDesc) const
|
[[maybe_unused]] boost::program_options::options_description& hiddenDesc) const
|
||||||
{
|
{
|
||||||
visibleDesc.add_options()
|
visibleDesc.add_options()
|
||||||
("cn", po::value<std::string>(), "The certificate's common name");
|
("cn", po::value<std::string>(), "The certificate's common name");
|
||||||
@ -39,7 +39,7 @@ void ApiSetupCommand::InitParameters(boost::program_options::options_description
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int ApiSetupCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int ApiSetupCommand::Run(const boost::program_options::variables_map& vm, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
String cn;
|
String cn;
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ String CAListCommand::GetShortDescription() const
|
|||||||
* @param hiddenDesc Register hidden parameters.
|
* @param hiddenDesc Register hidden parameters.
|
||||||
*/
|
*/
|
||||||
void CAListCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
void CAListCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
||||||
boost::program_options::options_description& hiddenDesc) const
|
[[maybe_unused]] boost::program_options::options_description& hiddenDesc) const
|
||||||
{
|
{
|
||||||
visibleDesc.add_options()
|
visibleDesc.add_options()
|
||||||
("all", "List all certificate signing requests, including signed. Note: Old requests are automatically cleaned by Icinga after 1 week.")
|
("all", "List all certificate signing requests, including signed. Note: Old requests are automatically cleaned by Icinga after 1 week.")
|
||||||
@ -54,7 +54,7 @@ void CAListCommand::InitParameters(boost::program_options::options_description&
|
|||||||
*
|
*
|
||||||
* @return An exit status.
|
* @return An exit status.
|
||||||
*/
|
*/
|
||||||
int CAListCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int CAListCommand::Run(const boost::program_options::variables_map& vm, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
Dictionary::Ptr requests = PkiUtility::GetCertificateRequests(vm.count("removed"));
|
Dictionary::Ptr requests = PkiUtility::GetCertificateRequests(vm.count("removed"));
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ ImpersonationLevel CARemoveCommand::GetImpersonationLevel() const
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int CARemoveCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int CARemoveCommand::Run(const boost::program_options::variables_map&, const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
String fingerPrint = ap[0];
|
String fingerPrint = ap[0];
|
||||||
String requestFile = ApiListener::GetCertificateRequestsDir() + "/" + fingerPrint + ".json";
|
String requestFile = ApiListener::GetCertificateRequestsDir() + "/" + fingerPrint + ".json";
|
||||||
|
@ -55,7 +55,7 @@ ImpersonationLevel CARestoreCommand::GetImpersonationLevel() const
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int CARestoreCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int CARestoreCommand::Run(const boost::program_options::variables_map&, const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
String fingerPrint = ap[0];
|
String fingerPrint = ap[0];
|
||||||
String removedRequestFile = ApiListener::GetCertificateRequestsDir() + "/" + fingerPrint + ".removed";
|
String removedRequestFile = ApiListener::GetCertificateRequestsDir() + "/" + fingerPrint + ".removed";
|
||||||
|
@ -55,7 +55,7 @@ ImpersonationLevel CASignCommand::GetImpersonationLevel() const
|
|||||||
*
|
*
|
||||||
* @return An exit status.
|
* @return An exit status.
|
||||||
*/
|
*/
|
||||||
int CASignCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int CASignCommand::Run(const boost::program_options::variables_map&, const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
String requestFile = ApiListener::GetCertificateRequestsDir() + "/" + ap[0] + ".json";
|
String requestFile = ApiListener::GetCertificateRequestsDir() + "/" + ap[0] + ".json";
|
||||||
|
|
||||||
|
@ -131,18 +131,18 @@ void CLICommand::Unregister(const std::vector<String>& name)
|
|||||||
GetRegistry().erase(name);
|
GetRegistry().erase(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<String> CLICommand::GetArgumentSuggestions(const String& argument, const String& word) const
|
std::vector<String> CLICommand::GetArgumentSuggestions([[maybe_unused]] const String& argument, [[maybe_unused]] const String& word) const
|
||||||
{
|
{
|
||||||
return std::vector<String>();
|
return std::vector<String>();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<String> CLICommand::GetPositionalSuggestions(const String& word) const
|
std::vector<String> CLICommand::GetPositionalSuggestions([[maybe_unused]] const String& word) const
|
||||||
{
|
{
|
||||||
return std::vector<String>();
|
return std::vector<String>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLICommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
void CLICommand::InitParameters([[maybe_unused]] boost::program_options::options_description& visibleDesc,
|
||||||
boost::program_options::options_description& hiddenDesc) const
|
[[maybe_unused]] boost::program_options::options_description& hiddenDesc) const
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
ImpersonationLevel CLICommand::GetImpersonationLevel() const
|
ImpersonationLevel CLICommand::GetImpersonationLevel() const
|
||||||
|
@ -167,7 +167,7 @@ ImpersonationLevel ConsoleCommand::GetImpersonationLevel() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ConsoleCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
void ConsoleCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
||||||
boost::program_options::options_description& hiddenDesc) const
|
[[maybe_unused]] boost::program_options::options_description& hiddenDesc) const
|
||||||
{
|
{
|
||||||
visibleDesc.add_options()
|
visibleDesc.add_options()
|
||||||
("connect,c", po::value<std::string>(), "connect to an Icinga 2 instance")
|
("connect,c", po::value<std::string>(), "connect to an Icinga 2 instance")
|
||||||
@ -215,7 +215,7 @@ char *ConsoleCommand::ConsoleCompleteHelper(const char *word, int state)
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int ConsoleCommand::Run(const po::variables_map& vm, const std::vector<std::string>& ap) const
|
int ConsoleCommand::Run(const po::variables_map& vm, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
#ifdef HAVE_EDITLINE
|
#ifdef HAVE_EDITLINE
|
||||||
rl_completion_entry_function = ConsoleCommand::ConsoleCompleteHelper;
|
rl_completion_entry_function = ConsoleCommand::ConsoleCompleteHelper;
|
||||||
|
@ -46,13 +46,18 @@ static po::variables_map g_AppParams;
|
|||||||
|
|
||||||
REGISTER_CLICOMMAND("daemon", DaemonCommand);
|
REGISTER_CLICOMMAND("daemon", DaemonCommand);
|
||||||
|
|
||||||
|
#ifdef HAVE_SYSTEMD
|
||||||
static inline
|
static inline
|
||||||
void NotifyStatus(const char* status)
|
void NotifyStatus(const char* status)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SYSTEMD
|
|
||||||
(void)sd_notifyf(0, "STATUS=%s", status);
|
(void)sd_notifyf(0, "STATUS=%s", status);
|
||||||
#endif /* HAVE_SYSTEMD */
|
|
||||||
}
|
}
|
||||||
|
#else /* HAVE_SYSTEMD */
|
||||||
|
static inline
|
||||||
|
void NotifyStatus(const char*)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif /* HAVE_SYSTEMD */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Daemonize(). On error, this function logs by itself and exits (i.e. does not return).
|
* Daemonize(). On error, this function logs by itself and exits (i.e. does not return).
|
||||||
@ -171,7 +176,7 @@ String DaemonCommand::GetShortDescription() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DaemonCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
void DaemonCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
||||||
boost::program_options::options_description& hiddenDesc) const
|
[[maybe_unused]] boost::program_options::options_description& hiddenDesc) const
|
||||||
{
|
{
|
||||||
visibleDesc.add_options()
|
visibleDesc.add_options()
|
||||||
("config,c", po::value<std::vector<std::string> >(), "parse a configuration file")
|
("config,c", po::value<std::vector<std::string> >(), "parse a configuration file")
|
||||||
@ -614,7 +619,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::string>& ap) const
|
int DaemonCommand::Run(const po::variables_map& vm, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
SetConsoleOutputCP(65001);
|
SetConsoleOutputCP(65001);
|
||||||
|
@ -44,7 +44,7 @@ ImpersonationLevel FeatureDisableCommand::GetImpersonationLevel() const
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int FeatureDisableCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int FeatureDisableCommand::Run(const boost::program_options::variables_map&, const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
if (ap.empty()) {
|
if (ap.empty()) {
|
||||||
Log(LogCritical, "cli", "Cannot disable feature(s). Name(s) are missing!");
|
Log(LogCritical, "cli", "Cannot disable feature(s). Name(s) are missing!");
|
||||||
|
@ -44,7 +44,7 @@ ImpersonationLevel FeatureEnableCommand::GetImpersonationLevel() const
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int FeatureEnableCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int FeatureEnableCommand::Run(const boost::program_options::variables_map&, const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
return FeatureUtility::EnableFeatures(ap);
|
return FeatureUtility::EnableFeatures(ap);
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ String FeatureListCommand::GetShortDescription() const
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int FeatureListCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int FeatureListCommand::Run(const boost::program_options::variables_map&, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
return FeatureUtility::ListFeatures();
|
return FeatureUtility::ListFeatures();
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ bool InternalSignalCommand::IsHidden() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InternalSignalCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
void InternalSignalCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
||||||
boost::program_options::options_description& hiddenDesc) const
|
[[maybe_unused]] boost::program_options::options_description& hiddenDesc) const
|
||||||
{
|
{
|
||||||
visibleDesc.add_options()
|
visibleDesc.add_options()
|
||||||
("pid,p", po::value<int>(), "Target PID")
|
("pid,p", po::value<int>(), "Target PID")
|
||||||
@ -43,7 +43,7 @@ void InternalSignalCommand::InitParameters(boost::program_options::options_descr
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int InternalSignalCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int InternalSignalCommand::Run(const boost::program_options::variables_map& vm, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
String signal = vm["sig"].as<String>();
|
String signal = vm["sig"].as<String>();
|
||||||
|
@ -47,7 +47,7 @@ int NodeWizardCommand::GetMaxArguments() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void NodeWizardCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
void NodeWizardCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
||||||
boost::program_options::options_description& hiddenDesc) const
|
[[maybe_unused]] boost::program_options::options_description& hiddenDesc) const
|
||||||
{
|
{
|
||||||
visibleDesc.add_options()
|
visibleDesc.add_options()
|
||||||
("verbose", "increase log level");
|
("verbose", "increase log level");
|
||||||
@ -59,7 +59,7 @@ void NodeWizardCommand::InitParameters(boost::program_options::options_descripti
|
|||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int NodeWizardCommand::Run(const boost::program_options::variables_map& vm,
|
int NodeWizardCommand::Run(const boost::program_options::variables_map& vm,
|
||||||
const std::vector<std::string>& ap) const
|
[[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
if (!vm.count("verbose"))
|
if (!vm.count("verbose"))
|
||||||
Logger::SetConsoleLogSeverity(LogCritical);
|
Logger::SetConsoleLogSeverity(LogCritical);
|
||||||
|
@ -36,7 +36,7 @@ String ObjectListCommand::GetShortDescription() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ObjectListCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
void ObjectListCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
||||||
boost::program_options::options_description& hiddenDesc) const
|
[[maybe_unused]] boost::program_options::options_description& hiddenDesc) const
|
||||||
{
|
{
|
||||||
visibleDesc.add_options()
|
visibleDesc.add_options()
|
||||||
("count,c", "display object counts by types")
|
("count,c", "display object counts by types")
|
||||||
@ -62,7 +62,7 @@ static time_t GetCtime(const String& path)
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int ObjectListCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int ObjectListCommand::Run(const boost::program_options::variables_map& vm, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
String objectfile = Configuration::ObjectsPath;
|
String objectfile = Configuration::ObjectsPath;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ String PKINewCACommand::GetShortDescription() const
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int PKINewCACommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int PKINewCACommand::Run(const boost::program_options::variables_map&, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
return PkiUtility::NewCa();
|
return PkiUtility::NewCa();
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ String PKINewCertCommand::GetShortDescription() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PKINewCertCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
void PKINewCertCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
||||||
boost::program_options::options_description& hiddenDesc) const
|
[[maybe_unused]] boost::program_options::options_description& hiddenDesc) const
|
||||||
{
|
{
|
||||||
visibleDesc.add_options()
|
visibleDesc.add_options()
|
||||||
("cn", po::value<std::string>(), "Common Name")
|
("cn", po::value<std::string>(), "Common Name")
|
||||||
@ -42,7 +42,7 @@ std::vector<String> PKINewCertCommand::GetArgumentSuggestions(const String& argu
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int PKINewCertCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int PKINewCertCommand::Run(const boost::program_options::variables_map& vm, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
if (!vm.count("cn")) {
|
if (!vm.count("cn")) {
|
||||||
Log(LogCritical, "cli", "Common name (--cn) must be specified.");
|
Log(LogCritical, "cli", "Common name (--cn) must be specified.");
|
||||||
|
@ -22,7 +22,7 @@ String PKIRequestCommand::GetShortDescription() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PKIRequestCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
void PKIRequestCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
||||||
boost::program_options::options_description& hiddenDesc) const
|
[[maybe_unused]] boost::program_options::options_description& hiddenDesc) const
|
||||||
{
|
{
|
||||||
visibleDesc.add_options()
|
visibleDesc.add_options()
|
||||||
("key", po::value<std::string>(), "Key file path (input)")
|
("key", po::value<std::string>(), "Key file path (input)")
|
||||||
@ -51,7 +51,7 @@ std::vector<String> PKIRequestCommand::GetArgumentSuggestions(const String& argu
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int PKIRequestCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int PKIRequestCommand::Run(const boost::program_options::variables_map& vm, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
if (!vm.count("host")) {
|
if (!vm.count("host")) {
|
||||||
Log(LogCritical, "cli", "Icinga 2 host (--host) must be specified.");
|
Log(LogCritical, "cli", "Icinga 2 host (--host) must be specified.");
|
||||||
|
@ -52,7 +52,7 @@ std::vector<String> PKISaveCertCommand::GetArgumentSuggestions(const String& arg
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int PKISaveCertCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int PKISaveCertCommand::Run(const boost::program_options::variables_map& vm, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
if (!vm.count("host")) {
|
if (!vm.count("host")) {
|
||||||
Log(LogCritical, "cli", "Icinga 2 host (--host) must be specified.");
|
Log(LogCritical, "cli", "Icinga 2 host (--host) must be specified.");
|
||||||
|
@ -20,7 +20,7 @@ String PKISignCSRCommand::GetShortDescription() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PKISignCSRCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
void PKISignCSRCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
||||||
boost::program_options::options_description& hiddenDesc) const
|
[[maybe_unused]] boost::program_options::options_description& hiddenDesc) const
|
||||||
{
|
{
|
||||||
visibleDesc.add_options()
|
visibleDesc.add_options()
|
||||||
("csr", po::value<std::string>(), "CSR file path (input)")
|
("csr", po::value<std::string>(), "CSR file path (input)")
|
||||||
@ -40,7 +40,7 @@ std::vector<String> PKISignCSRCommand::GetArgumentSuggestions(const String& argu
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int PKISignCSRCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int PKISignCSRCommand::Run(const boost::program_options::variables_map& vm, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
if (!vm.count("csr")) {
|
if (!vm.count("csr")) {
|
||||||
Log(LogCritical, "cli", "Certificate signing request file path (--csr) must be specified.");
|
Log(LogCritical, "cli", "Certificate signing request file path (--csr) must be specified.");
|
||||||
|
@ -22,7 +22,7 @@ String PKITicketCommand::GetShortDescription() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PKITicketCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
void PKITicketCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
||||||
boost::program_options::options_description& hiddenDesc) const
|
[[maybe_unused]] boost::program_options::options_description& hiddenDesc) const
|
||||||
{
|
{
|
||||||
visibleDesc.add_options()
|
visibleDesc.add_options()
|
||||||
("cn", po::value<std::string>(), "Certificate common name")
|
("cn", po::value<std::string>(), "Certificate common name")
|
||||||
@ -34,7 +34,7 @@ void PKITicketCommand::InitParameters(boost::program_options::options_descriptio
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int PKITicketCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int PKITicketCommand::Run(const boost::program_options::variables_map& vm, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
if (!vm.count("cn")) {
|
if (!vm.count("cn")) {
|
||||||
Log(LogCritical, "cli", "Common name (--cn) must be specified.");
|
Log(LogCritical, "cli", "Common name (--cn) must be specified.");
|
||||||
|
@ -23,7 +23,7 @@ String PKIVerifyCommand::GetShortDescription() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PKIVerifyCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
void PKIVerifyCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
||||||
boost::program_options::options_description& hiddenDesc) const
|
[[maybe_unused]] boost::program_options::options_description& hiddenDesc) const
|
||||||
{
|
{
|
||||||
visibleDesc.add_options()
|
visibleDesc.add_options()
|
||||||
("cn", po::value<std::string>(), "Common Name (optional). Use with '--cert' to check the CN in the certificate.")
|
("cn", po::value<std::string>(), "Common Name (optional). Use with '--cert' to check the CN in the certificate.")
|
||||||
@ -45,7 +45,7 @@ std::vector<String> PKIVerifyCommand::GetArgumentSuggestions(const String& argum
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int PKIVerifyCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int PKIVerifyCommand::Run(const boost::program_options::variables_map& vm, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
String cn, certFile, caCertFile, crlFile;
|
String cn, certFile, caCertFile, crlFile;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ String VariableGetCommand::GetShortDescription() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void VariableGetCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
void VariableGetCommand::InitParameters(boost::program_options::options_description& visibleDesc,
|
||||||
boost::program_options::options_description& hiddenDesc) const
|
[[maybe_unused]] boost::program_options::options_description& hiddenDesc) const
|
||||||
{
|
{
|
||||||
visibleDesc.add_options()
|
visibleDesc.add_options()
|
||||||
("current", "Uses the current value (i.e. from the running process, rather than from the vars file)");
|
("current", "Uses the current value (i.e. from the running process, rather than from the vars file)");
|
||||||
|
@ -34,7 +34,7 @@ String VariableListCommand::GetShortDescription() const
|
|||||||
*
|
*
|
||||||
* @returns An exit status.
|
* @returns An exit status.
|
||||||
*/
|
*/
|
||||||
int VariableListCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int VariableListCommand::Run(const boost::program_options::variables_map&, [[maybe_unused]] const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
String varsfile = Configuration::VarsPath;
|
String varsfile = Configuration::VarsPath;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ ExpressionResult Expression::Evaluate(ScriptFrame& frame, DebugHint *dhint) cons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Expression::GetReference(ScriptFrame& frame, bool init_dict, Value *parent, String *index, DebugHint **dhint) const
|
bool Expression::GetReference(ScriptFrame&, [[maybe_unused]] bool init_dict, [[maybe_unused]] Value* parent, [[maybe_unused]] String* index, DebugHint**) const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ LiteralExpression::LiteralExpression(Value value)
|
|||||||
: m_Value(std::move(value))
|
: m_Value(std::move(value))
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
ExpressionResult LiteralExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult LiteralExpression::DoEvaluate(ScriptFrame&, DebugHint*) const
|
||||||
{
|
{
|
||||||
return m_Value;
|
return m_Value;
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ VariableExpression::VariableExpression(String variable, std::vector<Expression::
|
|||||||
m_Imports.push_back(MakeIndexer(ScopeGlobal, "Icinga").release());
|
m_Imports.push_back(MakeIndexer(ScopeGlobal, "Icinga").release());
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult VariableExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult VariableExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
Value value;
|
Value value;
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ ExpressionResult VariableExpression::DoEvaluate(ScriptFrame& frame, DebugHint *d
|
|||||||
return ScriptGlobal::Get(m_Variable);
|
return ScriptGlobal::Get(m_Variable);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VariableExpression::GetReference(ScriptFrame& frame, bool init_dict, Value *parent, String *index, DebugHint **dhint) const
|
bool VariableExpression::GetReference(ScriptFrame& frame, [[maybe_unused]] bool init_dict, Value *parent, String *index, DebugHint **dhint) const
|
||||||
{
|
{
|
||||||
*index = m_Variable;
|
*index = m_Variable;
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ ExpressionResult RefExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint)
|
|||||||
return new Reference(parent, index);
|
return new Reference(parent, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult DerefExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult DerefExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand = m_Operand->Evaluate(frame);
|
ExpressionResult operand = m_Operand->Evaluate(frame);
|
||||||
CHECK_RESULT(operand);
|
CHECK_RESULT(operand);
|
||||||
@ -177,7 +177,7 @@ ExpressionResult DerefExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhin
|
|||||||
return ref->Get();
|
return ref->Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DerefExpression::GetReference(ScriptFrame& frame, bool init_dict, Value *parent, String *index, DebugHint **dhint) const
|
bool DerefExpression::GetReference(ScriptFrame& frame, [[maybe_unused]] bool init_dict, Value *parent, String *index, DebugHint**) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand = m_Operand->Evaluate(frame);
|
ExpressionResult operand = m_Operand->Evaluate(frame);
|
||||||
if (operand.GetCode() != ResultOK)
|
if (operand.GetCode() != ResultOK)
|
||||||
@ -190,7 +190,7 @@ bool DerefExpression::GetReference(ScriptFrame& frame, bool init_dict, Value *pa
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult NegateExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult NegateExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand = m_Operand->Evaluate(frame);
|
ExpressionResult operand = m_Operand->Evaluate(frame);
|
||||||
CHECK_RESULT(operand);
|
CHECK_RESULT(operand);
|
||||||
@ -198,7 +198,7 @@ ExpressionResult NegateExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhi
|
|||||||
return ~(long)operand.GetValue();
|
return ~(long)operand.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult LogicalNegateExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult LogicalNegateExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand = m_Operand->Evaluate(frame);
|
ExpressionResult operand = m_Operand->Evaluate(frame);
|
||||||
CHECK_RESULT(operand);
|
CHECK_RESULT(operand);
|
||||||
@ -206,7 +206,7 @@ ExpressionResult LogicalNegateExpression::DoEvaluate(ScriptFrame& frame, DebugHi
|
|||||||
return !operand.GetValue().ToBool();
|
return !operand.GetValue().ToBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult AddExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult AddExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -217,7 +217,7 @@ ExpressionResult AddExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint)
|
|||||||
return operand1.GetValue() + operand2.GetValue();
|
return operand1.GetValue() + operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult SubtractExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult SubtractExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -228,7 +228,7 @@ ExpressionResult SubtractExpression::DoEvaluate(ScriptFrame& frame, DebugHint *d
|
|||||||
return operand1.GetValue() - operand2.GetValue();
|
return operand1.GetValue() - operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult MultiplyExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult MultiplyExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -239,7 +239,7 @@ ExpressionResult MultiplyExpression::DoEvaluate(ScriptFrame& frame, DebugHint *d
|
|||||||
return operand1.GetValue() * operand2.GetValue();
|
return operand1.GetValue() * operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult DivideExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult DivideExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -250,7 +250,7 @@ ExpressionResult DivideExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhi
|
|||||||
return operand1.GetValue() / operand2.GetValue();
|
return operand1.GetValue() / operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult ModuloExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult ModuloExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -261,7 +261,7 @@ ExpressionResult ModuloExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhi
|
|||||||
return operand1.GetValue() % operand2.GetValue();
|
return operand1.GetValue() % operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult XorExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult XorExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -272,7 +272,7 @@ ExpressionResult XorExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint)
|
|||||||
return operand1.GetValue() ^ operand2.GetValue();
|
return operand1.GetValue() ^ operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult BinaryAndExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult BinaryAndExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -283,7 +283,7 @@ ExpressionResult BinaryAndExpression::DoEvaluate(ScriptFrame& frame, DebugHint *
|
|||||||
return operand1.GetValue() & operand2.GetValue();
|
return operand1.GetValue() & operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult BinaryOrExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult BinaryOrExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -294,7 +294,7 @@ ExpressionResult BinaryOrExpression::DoEvaluate(ScriptFrame& frame, DebugHint *d
|
|||||||
return operand1.GetValue() | operand2.GetValue();
|
return operand1.GetValue() | operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult ShiftLeftExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult ShiftLeftExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -305,7 +305,7 @@ ExpressionResult ShiftLeftExpression::DoEvaluate(ScriptFrame& frame, DebugHint *
|
|||||||
return operand1.GetValue() << operand2.GetValue();
|
return operand1.GetValue() << operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult ShiftRightExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult ShiftRightExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -316,7 +316,7 @@ ExpressionResult ShiftRightExpression::DoEvaluate(ScriptFrame& frame, DebugHint
|
|||||||
return operand1.GetValue() >> operand2.GetValue();
|
return operand1.GetValue() >> operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult EqualExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult EqualExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -327,7 +327,7 @@ ExpressionResult EqualExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhin
|
|||||||
return operand1.GetValue() == operand2.GetValue();
|
return operand1.GetValue() == operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult NotEqualExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult NotEqualExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -338,7 +338,7 @@ ExpressionResult NotEqualExpression::DoEvaluate(ScriptFrame& frame, DebugHint *d
|
|||||||
return operand1.GetValue() != operand2.GetValue();
|
return operand1.GetValue() != operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult LessThanExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult LessThanExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -349,7 +349,7 @@ ExpressionResult LessThanExpression::DoEvaluate(ScriptFrame& frame, DebugHint *d
|
|||||||
return operand1.GetValue() < operand2.GetValue();
|
return operand1.GetValue() < operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult GreaterThanExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult GreaterThanExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -360,7 +360,7 @@ ExpressionResult GreaterThanExpression::DoEvaluate(ScriptFrame& frame, DebugHint
|
|||||||
return operand1.GetValue() > operand2.GetValue();
|
return operand1.GetValue() > operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult LessThanOrEqualExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult LessThanOrEqualExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -371,7 +371,7 @@ ExpressionResult LessThanOrEqualExpression::DoEvaluate(ScriptFrame& frame, Debug
|
|||||||
return operand1.GetValue() <= operand2.GetValue();
|
return operand1.GetValue() <= operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult GreaterThanOrEqualExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult GreaterThanOrEqualExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -382,7 +382,7 @@ ExpressionResult GreaterThanOrEqualExpression::DoEvaluate(ScriptFrame& frame, De
|
|||||||
return operand1.GetValue() >= operand2.GetValue();
|
return operand1.GetValue() >= operand2.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult InExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult InExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand2 = m_Operand2->Evaluate(frame);
|
ExpressionResult operand2 = m_Operand2->Evaluate(frame);
|
||||||
CHECK_RESULT(operand2);
|
CHECK_RESULT(operand2);
|
||||||
@ -399,7 +399,7 @@ ExpressionResult InExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint)
|
|||||||
return arr->Contains(operand1.GetValue());
|
return arr->Contains(operand1.GetValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult NotInExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult NotInExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand2 = m_Operand2->Evaluate(frame);
|
ExpressionResult operand2 = m_Operand2->Evaluate(frame);
|
||||||
CHECK_RESULT(operand2);
|
CHECK_RESULT(operand2);
|
||||||
@ -416,7 +416,7 @@ ExpressionResult NotInExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhin
|
|||||||
return !arr->Contains(operand1.GetValue());
|
return !arr->Contains(operand1.GetValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult LogicalAndExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult LogicalAndExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -431,7 +431,7 @@ ExpressionResult LogicalAndExpression::DoEvaluate(ScriptFrame& frame, DebugHint
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult LogicalOrExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult LogicalOrExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
ExpressionResult operand1 = m_Operand1->Evaluate(frame);
|
||||||
CHECK_RESULT(operand1);
|
CHECK_RESULT(operand1);
|
||||||
@ -446,7 +446,7 @@ ExpressionResult LogicalOrExpression::DoEvaluate(ScriptFrame& frame, DebugHint *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult FunctionCallExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult FunctionCallExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
Value self, vfunc;
|
Value self, vfunc;
|
||||||
String index;
|
String index;
|
||||||
@ -493,7 +493,7 @@ ExpressionResult FunctionCallExpression::DoEvaluate(ScriptFrame& frame, DebugHin
|
|||||||
return VMOps::FunctionCall(frame, self, func, arguments);
|
return VMOps::FunctionCall(frame, self, func, arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult ArrayExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult ArrayExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ArrayData result;
|
ArrayData result;
|
||||||
result.reserve(m_Expressions.size());
|
result.reserve(m_Expressions.size());
|
||||||
@ -539,7 +539,7 @@ ExpressionResult DictExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult GetScopeExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult GetScopeExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
if (m_ScopeSpec == ScopeLocal)
|
if (m_ScopeSpec == ScopeLocal)
|
||||||
return frame.Locals;
|
return frame.Locals;
|
||||||
@ -671,7 +671,7 @@ void SetExpression::SetOverrideFrozen()
|
|||||||
m_OverrideFrozen = true;
|
m_OverrideFrozen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult SetConstExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult SetConstExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
auto globals = ScriptGlobal::GetGlobals();
|
auto globals = ScriptGlobal::GetGlobals();
|
||||||
|
|
||||||
@ -716,7 +716,7 @@ ExpressionResult WhileExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhin
|
|||||||
return Empty;
|
return Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult ReturnExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult ReturnExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult operand = m_Operand->Evaluate(frame);
|
ExpressionResult operand = m_Operand->Evaluate(frame);
|
||||||
CHECK_RESULT(operand);
|
CHECK_RESULT(operand);
|
||||||
@ -724,12 +724,12 @@ ExpressionResult ReturnExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhi
|
|||||||
return ExpressionResult(operand.GetValue(), ResultReturn);
|
return ExpressionResult(operand.GetValue(), ResultReturn);
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult BreakExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult BreakExpression::DoEvaluate(ScriptFrame&, DebugHint*) const
|
||||||
{
|
{
|
||||||
return ExpressionResult(Empty, ResultBreak);
|
return ExpressionResult(Empty, ResultBreak);
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult ContinueExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult ContinueExpression::DoEvaluate(ScriptFrame&, DebugHint*) const
|
||||||
{
|
{
|
||||||
return ExpressionResult(Empty, ResultContinue);
|
return ExpressionResult(Empty, ResultContinue);
|
||||||
}
|
}
|
||||||
@ -844,7 +844,7 @@ void icinga::BindToScope(std::unique_ptr<Expression>& expr, ScopeSpecifier scope
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult ThrowExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult ThrowExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ExpressionResult messageres = m_Message->Evaluate(frame);
|
ExpressionResult messageres = m_Message->Evaluate(frame);
|
||||||
CHECK_RESULT(messageres);
|
CHECK_RESULT(messageres);
|
||||||
@ -902,12 +902,12 @@ ExpressionResult ImportDefaultTemplatesExpression::DoEvaluate(ScriptFrame& frame
|
|||||||
return Empty;
|
return Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult FunctionExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult FunctionExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
return VMOps::NewFunction(frame, m_Name, m_Args, m_ClosedVars, m_Expression);
|
return VMOps::NewFunction(frame, m_Name, m_Args, m_ClosedVars, m_Expression);
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult ApplyExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult ApplyExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
if (frame.Sandboxed)
|
if (frame.Sandboxed)
|
||||||
BOOST_THROW_EXCEPTION(ScriptError("Apply rules are not allowed in sandbox mode.", m_DebugInfo));
|
BOOST_THROW_EXCEPTION(ScriptError("Apply rules are not allowed in sandbox mode.", m_DebugInfo));
|
||||||
@ -919,7 +919,7 @@ ExpressionResult ApplyExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhin
|
|||||||
m_Package, m_FKVar, m_FVVar, m_FTerm, m_ClosedVars, m_IgnoreOnError, m_Expression, m_DebugInfo);
|
m_Package, m_FKVar, m_FVVar, m_FTerm, m_ClosedVars, m_IgnoreOnError, m_Expression, m_DebugInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult NamespaceExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult NamespaceExpression::DoEvaluate(ScriptFrame&, DebugHint*) const
|
||||||
{
|
{
|
||||||
Namespace::Ptr ns = new Namespace(true);
|
Namespace::Ptr ns = new Namespace(true);
|
||||||
|
|
||||||
@ -1046,7 +1046,7 @@ ExpressionResult IncludeExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dh
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionResult BreakpointExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
ExpressionResult BreakpointExpression::DoEvaluate(ScriptFrame& frame, DebugHint*) const
|
||||||
{
|
{
|
||||||
ScriptBreakpoint(frame, nullptr, GetDebugInfo());
|
ScriptBreakpoint(frame, nullptr, GetDebugInfo());
|
||||||
|
|
||||||
|
@ -588,16 +588,16 @@ Dictionary::Ptr ApiActions::RemoveDowntime(const ConfigObject::Ptr& object,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Dictionary::Ptr ApiActions::ShutdownProcess(const ConfigObject::Ptr& object,
|
Dictionary::Ptr ApiActions::ShutdownProcess(const ConfigObject::Ptr&,
|
||||||
const Dictionary::Ptr& params)
|
[[maybe_unused]] const Dictionary::Ptr& params)
|
||||||
{
|
{
|
||||||
Application::RequestShutdown();
|
Application::RequestShutdown();
|
||||||
|
|
||||||
return ApiActions::CreateResult(200, "Shutting down Icinga 2.");
|
return ApiActions::CreateResult(200, "Shutting down Icinga 2.");
|
||||||
}
|
}
|
||||||
|
|
||||||
Dictionary::Ptr ApiActions::RestartProcess(const ConfigObject::Ptr& object,
|
Dictionary::Ptr ApiActions::RestartProcess(const ConfigObject::Ptr&,
|
||||||
const Dictionary::Ptr& params)
|
[[maybe_unused]] const Dictionary::Ptr& params)
|
||||||
{
|
{
|
||||||
Application::RequestRestart();
|
Application::RequestRestart();
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ void ApiEvents::StaticInitialize()
|
|||||||
ConfigObject::OnVersionChanged.connect(&ApiEvents::OnVersionChangedHandler);
|
ConfigObject::OnVersionChanged.connect(&ApiEvents::OnVersionChangedHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApiEvents::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, const MessageOrigin::Ptr& origin)
|
void ApiEvents::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, const MessageOrigin::Ptr&)
|
||||||
{
|
{
|
||||||
std::vector<EventQueue::Ptr> queues = EventQueue::GetQueuesForType("CheckResult");
|
std::vector<EventQueue::Ptr> queues = EventQueue::GetQueuesForType("CheckResult");
|
||||||
auto inboxes (EventsRouter::GetInstance().GetInboxes(EventType::CheckResult));
|
auto inboxes (EventsRouter::GetInstance().GetInboxes(EventType::CheckResult));
|
||||||
@ -68,7 +68,7 @@ void ApiEvents::CheckResultHandler(const Checkable::Ptr& checkable, const CheckR
|
|||||||
inboxes.Push(std::move(result));
|
inboxes.Push(std::move(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApiEvents::StateChangeHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type, const MessageOrigin::Ptr& origin)
|
void ApiEvents::StateChangeHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType, const MessageOrigin::Ptr&)
|
||||||
{
|
{
|
||||||
std::vector<EventQueue::Ptr> queues = EventQueue::GetQueuesForType("StateChange");
|
std::vector<EventQueue::Ptr> queues = EventQueue::GetQueuesForType("StateChange");
|
||||||
auto inboxes (EventsRouter::GetInstance().GetInboxes(EventType::StateChange));
|
auto inboxes (EventsRouter::GetInstance().GetInboxes(EventType::StateChange));
|
||||||
@ -106,7 +106,7 @@ void ApiEvents::StateChangeHandler(const Checkable::Ptr& checkable, const CheckR
|
|||||||
|
|
||||||
void ApiEvents::NotificationSentToAllUsersHandler(const Notification::Ptr& notification,
|
void ApiEvents::NotificationSentToAllUsersHandler(const Notification::Ptr& notification,
|
||||||
const Checkable::Ptr& checkable, const std::set<User::Ptr>& users, NotificationType type,
|
const Checkable::Ptr& checkable, const std::set<User::Ptr>& users, NotificationType type,
|
||||||
const CheckResult::Ptr& cr, const String& author, const String& text, const MessageOrigin::Ptr& origin)
|
const CheckResult::Ptr& cr, const String& author, const String& text, const MessageOrigin::Ptr&)
|
||||||
{
|
{
|
||||||
std::vector<EventQueue::Ptr> queues = EventQueue::GetQueuesForType("Notification");
|
std::vector<EventQueue::Ptr> queues = EventQueue::GetQueuesForType("Notification");
|
||||||
auto inboxes (EventsRouter::GetInstance().GetInboxes(EventType::Notification));
|
auto inboxes (EventsRouter::GetInstance().GetInboxes(EventType::Notification));
|
||||||
@ -152,7 +152,7 @@ void ApiEvents::NotificationSentToAllUsersHandler(const Notification::Ptr& notif
|
|||||||
inboxes.Push(std::move(result));
|
inboxes.Push(std::move(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApiEvents::FlappingChangedHandler(const Checkable::Ptr& checkable, const MessageOrigin::Ptr& origin)
|
void ApiEvents::FlappingChangedHandler(const Checkable::Ptr& checkable, const MessageOrigin::Ptr&)
|
||||||
{
|
{
|
||||||
std::vector<EventQueue::Ptr> queues = EventQueue::GetQueuesForType("Flapping");
|
std::vector<EventQueue::Ptr> queues = EventQueue::GetQueuesForType("Flapping");
|
||||||
auto inboxes (EventsRouter::GetInstance().GetInboxes(EventType::Flapping));
|
auto inboxes (EventsRouter::GetInstance().GetInboxes(EventType::Flapping));
|
||||||
@ -190,7 +190,7 @@ void ApiEvents::FlappingChangedHandler(const Checkable::Ptr& checkable, const Me
|
|||||||
|
|
||||||
void ApiEvents::AcknowledgementSetHandler(const Checkable::Ptr& checkable,
|
void ApiEvents::AcknowledgementSetHandler(const Checkable::Ptr& checkable,
|
||||||
const String& author, const String& comment, AcknowledgementType type,
|
const String& author, const String& comment, AcknowledgementType type,
|
||||||
bool notify, bool persistent, double, double expiry, const MessageOrigin::Ptr& origin)
|
bool notify, bool persistent, double, double expiry, const MessageOrigin::Ptr&)
|
||||||
{
|
{
|
||||||
std::vector<EventQueue::Ptr> queues = EventQueue::GetQueuesForType("AcknowledgementSet");
|
std::vector<EventQueue::Ptr> queues = EventQueue::GetQueuesForType("AcknowledgementSet");
|
||||||
auto inboxes (EventsRouter::GetInstance().GetInboxes(EventType::AcknowledgementSet));
|
auto inboxes (EventsRouter::GetInstance().GetInboxes(EventType::AcknowledgementSet));
|
||||||
@ -229,7 +229,7 @@ void ApiEvents::AcknowledgementSetHandler(const Checkable::Ptr& checkable,
|
|||||||
inboxes.Push(std::move(result));
|
inboxes.Push(std::move(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApiEvents::AcknowledgementClearedHandler(const Checkable::Ptr& checkable, const String& removedBy, double, const MessageOrigin::Ptr& origin)
|
void ApiEvents::AcknowledgementClearedHandler(const Checkable::Ptr& checkable, [[maybe_unused]] const String& removedBy, double, const MessageOrigin::Ptr&)
|
||||||
{
|
{
|
||||||
std::vector<EventQueue::Ptr> queues = EventQueue::GetQueuesForType("AcknowledgementCleared");
|
std::vector<EventQueue::Ptr> queues = EventQueue::GetQueuesForType("AcknowledgementCleared");
|
||||||
auto inboxes (EventsRouter::GetInstance().GetInboxes(EventType::AcknowledgementCleared));
|
auto inboxes (EventsRouter::GetInstance().GetInboxes(EventType::AcknowledgementCleared));
|
||||||
|
@ -277,7 +277,7 @@ std::pair<Dictionary::Ptr, Array::Ptr> CIB::GetFeatureStats()
|
|||||||
|
|
||||||
REGISTER_STATSFUNCTION(CIB, &CIB::StatsFunc);
|
REGISTER_STATSFUNCTION(CIB, &CIB::StatsFunc);
|
||||||
|
|
||||||
void CIB::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata) {
|
void CIB::StatsFunc(const Dictionary::Ptr& status, [[maybe_unused]] const Array::Ptr& perfdata) {
|
||||||
double interval = Utility::GetTime() - Application::GetStartTime();
|
double interval = Utility::GetTime() - Application::GetStartTime();
|
||||||
|
|
||||||
if (interval > 60)
|
if (interval > 60)
|
||||||
|
@ -12,7 +12,7 @@ using namespace icinga;
|
|||||||
|
|
||||||
REGISTER_TYPE(CustomVarObject);
|
REGISTER_TYPE(CustomVarObject);
|
||||||
|
|
||||||
void CustomVarObject::ValidateVars(const Lazy<Dictionary::Ptr>& lvalue, const ValidationUtils& utils)
|
void CustomVarObject::ValidateVars(const Lazy<Dictionary::Ptr>& lvalue, const ValidationUtils&)
|
||||||
{
|
{
|
||||||
MacroProcessor::ValidateCustomVars(this, lvalue());
|
MacroProcessor::ValidateCustomVars(this, lvalue());
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ INITIALIZE_ONCE_WITH_PRIORITY([]() {
|
|||||||
|
|
||||||
REGISTER_STATSFUNCTION(IcingaApplication, &IcingaApplication::StatsFunc);
|
REGISTER_STATSFUNCTION(IcingaApplication, &IcingaApplication::StatsFunc);
|
||||||
|
|
||||||
void IcingaApplication::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
|
void IcingaApplication::StatsFunc(const Dictionary::Ptr& status, [[maybe_unused]] const Array::Ptr& perfdata)
|
||||||
{
|
{
|
||||||
DictionaryData nodes;
|
DictionaryData nodes;
|
||||||
|
|
||||||
@ -310,12 +310,12 @@ String IcingaApplication::GetEnvironment() const
|
|||||||
return Application::GetAppEnvironment();
|
return Application::GetAppEnvironment();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IcingaApplication::SetEnvironment(const String& value, bool suppress_events, const Value& cookie)
|
void IcingaApplication::SetEnvironment(const String& value, [[maybe_unused]] bool suppress_event, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
Application::SetAppEnvironment(value);
|
Application::SetAppEnvironment(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IcingaApplication::ValidateVars(const Lazy<Dictionary::Ptr>& lvalue, const ValidationUtils& utils)
|
void IcingaApplication::ValidateVars(const Lazy<Dictionary::Ptr>& lvalue, const ValidationUtils&)
|
||||||
{
|
{
|
||||||
MacroProcessor::ValidateCustomVars(this, lvalue());
|
MacroProcessor::ValidateCustomVars(this, lvalue());
|
||||||
}
|
}
|
||||||
|
@ -370,7 +370,7 @@ void TimePeriod::Dump()
|
|||||||
Log(LogDebug, "TimePeriod", "---");
|
Log(LogDebug, "TimePeriod", "---");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TimePeriod::ValidateRanges(const Lazy<Dictionary::Ptr>& lvalue, const ValidationUtils& utils)
|
void TimePeriod::ValidateRanges(const Lazy<Dictionary::Ptr>& lvalue, const ValidationUtils&)
|
||||||
{
|
{
|
||||||
if (!lvalue())
|
if (!lvalue())
|
||||||
return;
|
return;
|
||||||
|
@ -529,7 +529,7 @@ void IcingaDB::UpdateAllConfigObjects()
|
|||||||
|
|
||||||
// enqueue a callback that will notify us once all previous queries were executed and wait for this event
|
// enqueue a callback that will notify us once all previous queries were executed and wait for this event
|
||||||
std::promise<void> p;
|
std::promise<void> p;
|
||||||
m_Rcon->EnqueueCallback([&p](boost::asio::yield_context& yc) { p.set_value(); }, Prio::Config);
|
m_Rcon->EnqueueCallback([&p](boost::asio::yield_context&) { p.set_value(); }, Prio::Config);
|
||||||
p.get_future().wait();
|
p.get_future().wait();
|
||||||
|
|
||||||
auto endTime (Utility::GetTime());
|
auto endTime (Utility::GetTime());
|
||||||
|
@ -95,7 +95,7 @@ void IcingaDB::Start(bool runtimeCreated)
|
|||||||
GetEnableTls(), GetInsecureNoverify(), GetCertPath(), GetKeyPath(), GetCaPath(), GetCrlPath(),
|
GetEnableTls(), GetInsecureNoverify(), GetCertPath(), GetKeyPath(), GetCaPath(), GetCrlPath(),
|
||||||
GetTlsProtocolmin(), GetCipherList(), GetConnectTimeout(), GetDebugInfo(), m_Rcon);
|
GetTlsProtocolmin(), GetCipherList(), GetConnectTimeout(), GetDebugInfo(), m_Rcon);
|
||||||
|
|
||||||
con->SetConnectedCallback([this, con](boost::asio::yield_context& yc) {
|
con->SetConnectedCallback([this, con](boost::asio::yield_context&) {
|
||||||
con->SetConnectedCallback(nullptr);
|
con->SetConnectedCallback(nullptr);
|
||||||
|
|
||||||
size_t pending = --m_PendingRcons;
|
size_t pending = --m_PendingRcons;
|
||||||
@ -110,7 +110,7 @@ void IcingaDB::Start(bool runtimeCreated)
|
|||||||
|
|
||||||
m_PendingRcons = m_Rcons.size();
|
m_PendingRcons = m_Rcons.size();
|
||||||
|
|
||||||
m_Rcon->SetConnectedCallback([this](boost::asio::yield_context& yc) {
|
m_Rcon->SetConnectedCallback([this](boost::asio::yield_context&) {
|
||||||
m_Rcon->SetConnectedCallback(nullptr);
|
m_Rcon->SetConnectedCallback(nullptr);
|
||||||
|
|
||||||
for (auto& kv : m_Rcons) {
|
for (auto& kv : m_Rcons) {
|
||||||
|
@ -8,7 +8,7 @@ using namespace icinga;
|
|||||||
|
|
||||||
REGISTER_FUNCTION_NONCONST(Internal, NullEvent, &NullEventTask::ScriptFunc, "checkable:resolvedMacros:useResolvedMacros");
|
REGISTER_FUNCTION_NONCONST(Internal, NullEvent, &NullEventTask::ScriptFunc, "checkable:resolvedMacros:useResolvedMacros");
|
||||||
|
|
||||||
void NullEventTask::ScriptFunc(const Checkable::Ptr& checkable, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
|
void NullEventTask::ScriptFunc(const Checkable::Ptr& checkable, [[maybe_unused]] const Dictionary::Ptr& resolvedMacros, [[maybe_unused]] bool useResolvedMacros)
|
||||||
{
|
{
|
||||||
REQUIRE_NOT_NULL(checkable);
|
REQUIRE_NOT_NULL(checkable);
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ double ApiListener::GetTlsHandshakeTimeout() const
|
|||||||
return Configuration::TlsHandshakeTimeout;
|
return Configuration::TlsHandshakeTimeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApiListener::SetTlsHandshakeTimeout(double value, bool suppress_events, const Value& cookie)
|
void ApiListener::SetTlsHandshakeTimeout(double value, [[maybe_unused]] bool suppress_events, [[maybe_unused]] const Value& cookie)
|
||||||
{
|
{
|
||||||
Configuration::TlsHandshakeTimeout = value;
|
Configuration::TlsHandshakeTimeout = value;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ void JsonRpcConnection::HandleAndWriteHeartbeats(boost::asio::yield_context yc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Value JsonRpcConnection::HeartbeatAPIHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params)
|
Value JsonRpcConnection::HeartbeatAPIHandler(const MessageOrigin::Ptr&, [[maybe_unused]] const Dictionary::Ptr& params)
|
||||||
{
|
{
|
||||||
return Empty;
|
return Empty;
|
||||||
}
|
}
|
||||||
|
@ -243,7 +243,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
|
|||||||
/* GetFieldId */
|
/* GetFieldId */
|
||||||
m_Header << "\t" << "int GetFieldId(const String& name) const override;" << std::endl;
|
m_Header << "\t" << "int GetFieldId(const String& name) const override;" << std::endl;
|
||||||
|
|
||||||
m_Impl << "int TypeImpl<" << klass.Name << ">::GetFieldId(const String& name) const" << std::endl
|
m_Impl << "int TypeImpl<" << klass.Name << ">::GetFieldId([[maybe_unused]] const String& name) const" << std::endl
|
||||||
<< "{" << std::endl;
|
<< "{" << std::endl;
|
||||||
|
|
||||||
if (!klass.Fields.empty()) {
|
if (!klass.Fields.empty()) {
|
||||||
@ -310,7 +310,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
|
|||||||
/* GetFieldInfo */
|
/* GetFieldInfo */
|
||||||
m_Header << "\t" << "Field GetFieldInfo(int id) const override;" << std::endl;
|
m_Header << "\t" << "Field GetFieldInfo(int id) const override;" << std::endl;
|
||||||
|
|
||||||
m_Impl << "Field TypeImpl<" << klass.Name << ">::GetFieldInfo(int id) const" << std::endl
|
m_Impl << "Field TypeImpl<" << klass.Name << ">::GetFieldInfo([[maybe_unused]] int id) const" << std::endl
|
||||||
<< "{" << std::endl;
|
<< "{" << std::endl;
|
||||||
|
|
||||||
if (!klass.Parent.empty())
|
if (!klass.Parent.empty())
|
||||||
@ -411,7 +411,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
|
|||||||
m_Header << "public:" << std::endl
|
m_Header << "public:" << std::endl
|
||||||
<< "\t" << "void RegisterAttributeHandler(int fieldId, const Type::AttributeHandler& callback) override;" << std::endl;
|
<< "\t" << "void RegisterAttributeHandler(int fieldId, const Type::AttributeHandler& callback) override;" << std::endl;
|
||||||
|
|
||||||
m_Impl << "void TypeImpl<" << klass.Name << ">::RegisterAttributeHandler(int fieldId, const Type::AttributeHandler& callback)" << std::endl
|
m_Impl << "void TypeImpl<" << klass.Name << ">::RegisterAttributeHandler([[maybe_unused]] int fieldId, [[maybe_unused]] const Type::AttributeHandler& callback)" << std::endl
|
||||||
<< "{" << std::endl;
|
<< "{" << std::endl;
|
||||||
|
|
||||||
if (!klass.Parent.empty())
|
if (!klass.Parent.empty())
|
||||||
@ -461,7 +461,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
|
|||||||
/* Validate */
|
/* Validate */
|
||||||
m_Header << "\t" << "void Validate(int types, const ValidationUtils& utils) override;" << std::endl;
|
m_Header << "\t" << "void Validate(int types, const ValidationUtils& utils) override;" << std::endl;
|
||||||
|
|
||||||
m_Impl << "void ObjectImpl<" << klass.Name << ">::Validate(int types, const ValidationUtils& utils)" << std::endl
|
m_Impl << "void ObjectImpl<" << klass.Name << ">::Validate([[maybe_unused]] int types, [[maybe_unused]] const ValidationUtils& utils)" << std::endl
|
||||||
<< "{" << std::endl;
|
<< "{" << std::endl;
|
||||||
|
|
||||||
if (!klass.Parent.empty())
|
if (!klass.Parent.empty())
|
||||||
@ -487,7 +487,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
|
|||||||
|
|
||||||
m_Header << "\t" << "void SimpleValidate" << field.GetFriendlyName() << "(const Lazy<" << field.Type.GetRealType() << ">& " << argName << ", const ValidationUtils& utils);" << std::endl;
|
m_Header << "\t" << "void SimpleValidate" << field.GetFriendlyName() << "(const Lazy<" << field.Type.GetRealType() << ">& " << argName << ", const ValidationUtils& utils);" << std::endl;
|
||||||
|
|
||||||
m_Impl << "void ObjectImpl<" << klass.Name << ">::SimpleValidate" << field.GetFriendlyName() << "(const Lazy<" << field.Type.GetRealType() << ">& " << argName << ", const ValidationUtils& utils)" << std::endl
|
m_Impl << "void ObjectImpl<" << klass.Name << ">::SimpleValidate" << field.GetFriendlyName() << "([[maybe_unused]] const Lazy<" << field.Type.GetRealType() << ">& " << argName << ", [[maybe_unused]] const ValidationUtils& utils)" << std::endl
|
||||||
<< "{" << std::endl;
|
<< "{" << std::endl;
|
||||||
|
|
||||||
if (field.Attributes & FARequired) {
|
if (field.Attributes & FARequired) {
|
||||||
@ -511,7 +511,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
|
|||||||
if (field.Type.ArrayRank > 0) {
|
if (field.Type.ArrayRank > 0) {
|
||||||
m_Impl << "\t" << "if (avalue()) {" << std::endl
|
m_Impl << "\t" << "if (avalue()) {" << std::endl
|
||||||
<< "\t\t" << "ObjectLock olock(avalue());" << std::endl
|
<< "\t\t" << "ObjectLock olock(avalue());" << std::endl
|
||||||
<< "\t\t" << "for (const Value& value : avalue()) {" << std::endl;
|
<< "\t\t" << "for ([[maybe_unused]] const Value& value : avalue()) {" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ftype = FieldTypeToIcingaName(field, true);
|
std::string ftype = FieldTypeToIcingaName(field, true);
|
||||||
@ -742,7 +742,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
|
|||||||
m_Header << "public:" << std::endl
|
m_Header << "public:" << std::endl
|
||||||
<< "\t" << "Object::Ptr NavigateField(int id) const override;" << std::endl;
|
<< "\t" << "Object::Ptr NavigateField(int id) const override;" << std::endl;
|
||||||
|
|
||||||
m_Impl << "Object::Ptr ObjectImpl<" << klass.Name << ">::NavigateField(int id) const" << std::endl
|
m_Impl << "Object::Ptr ObjectImpl<" << klass.Name << ">::NavigateField([[maybe_unused]] int id) const" << std::endl
|
||||||
<< "{" << std::endl;
|
<< "{" << std::endl;
|
||||||
|
|
||||||
if (!klass.Parent.empty())
|
if (!klass.Parent.empty())
|
||||||
@ -845,7 +845,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
|
|||||||
} else {
|
} else {
|
||||||
m_Header << ";" << std::endl;
|
m_Header << ";" << std::endl;
|
||||||
|
|
||||||
m_Impl << "void ObjectImpl<" << klass.Name << ">::Set" << field.GetFriendlyName() << "(" << field.Type.GetArgumentType() << " value, bool suppress_events, const Value& cookie)" << std::endl
|
m_Impl << "void ObjectImpl<" << klass.Name << ">::Set" << field.GetFriendlyName() << "([[maybe_unused]] " << field.Type.GetArgumentType() << " value, bool suppress_events, const Value& cookie)" << std::endl
|
||||||
<< "{" << std::endl;
|
<< "{" << std::endl;
|
||||||
|
|
||||||
if (field.Type.IsName || !field.TrackAccessor.empty() || field.Attributes & FASignalWithOldValue)
|
if (field.Type.IsName || !field.TrackAccessor.empty() || field.Attributes & FASignalWithOldValue)
|
||||||
@ -1104,12 +1104,12 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
|
|||||||
|
|
||||||
void ClassCompiler::CodeGenValidator(const std::string& name, const std::string& klass, const std::vector<Rule>& rules, const std::string& field, const FieldType& fieldType, ValidatorType validatorType)
|
void ClassCompiler::CodeGenValidator(const std::string& name, const std::string& klass, const std::vector<Rule>& rules, const std::string& field, const FieldType& fieldType, ValidatorType validatorType)
|
||||||
{
|
{
|
||||||
m_Impl << "static void TIValidate" << name << "(const intrusive_ptr<ObjectImpl<" << klass << "> >& object, ";
|
m_Impl << "static void TIValidate" << name << "([[maybe_unused]] const intrusive_ptr<ObjectImpl<" << klass << "> >& object, ";
|
||||||
|
|
||||||
if (validatorType != ValidatorField)
|
if (validatorType != ValidatorField)
|
||||||
m_Impl << "const String& key, ";
|
m_Impl << "[[maybe_unused]] const String& key, ";
|
||||||
|
|
||||||
m_Impl << fieldType.GetArgumentType() << " value, std::vector<String>& location, const ValidationUtils& utils)" << std::endl
|
m_Impl << "[[maybe_unused]] " << fieldType.GetArgumentType() << " value, [[maybe_unused]] std::vector<String>& location, [[maybe_unused]] const ValidationUtils& utils)" << std::endl
|
||||||
<< "{" << std::endl;
|
<< "{" << std::endl;
|
||||||
|
|
||||||
if (validatorType == ValidatorField) {
|
if (validatorType == ValidatorField) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user