icinga2/lib/icinga/envresolver.cpp
Alexander A. Klimov 91901eafd8 Introduce EnvResolver
refs #6259
2023-02-06 11:25:25 +01:00

21 lines
405 B
C++

/* Icinga 2 | (c) 2020 Icinga GmbH | GPLv2+ */
#include "base/string.hpp"
#include "base/value.hpp"
#include "icinga/envresolver.hpp"
#include "icinga/checkresult.hpp"
#include <cstdlib>
using namespace icinga;
bool EnvResolver::ResolveMacro(const String& macro, const CheckResult::Ptr&, Value *result) const
{
auto value (getenv(macro.CStr()));
if (value) {
*result = value;
}
return value;
}