Merge pull request #9662 from Icinga/Repair#9627

Repair DSL Namespace values being constant broken in #9627
This commit is contained in:
Julian Brost 2023-02-20 16:35:36 +01:00 committed by GitHub
commit bda8be343b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ void Namespace::Set(const String& field, const Value& value, bool isConst, const
auto nsVal = m_Data.find(field);
if (nsVal == m_Data.end()) {
m_Data[field] = NamespaceValue{value, isConst};
m_Data[field] = NamespaceValue{value, isConst || m_ConstValues};
} else {
if (nsVal->second.Const) {
BOOST_THROW_EXCEPTION(ScriptError("Constant must not be modified.", debugInfo));

View File

@ -36,7 +36,7 @@ INITIALIZE_ONCE_WITH_PRIORITY([]() {
l_StatsNS = new Namespace(true);
globalNS->Set("StatsFunctions", l_StatsNS, true);
globalNS->Set("Internal", new Namespace(true), true);
globalNS->Set("Internal", new Namespace(), true);
}, InitializePriority::CreateNamespaces);
INITIALIZE_ONCE_WITH_PRIORITY([]() {