]> granicus.if.org Git - icinga2/commitdiff
Fix another bug with relative object names.
authorGunnar Beutner <gunnar@beutner.name>
Sat, 5 Apr 2014 21:07:52 +0000 (23:07 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Sat, 5 Apr 2014 21:23:49 +0000 (23:23 +0200)
Refs #5925

lib/config/aexpression.cpp
lib/config/configitem.cpp

index 46e81490279a7309da6b01525dba450ff8cb4cf7..3a8299137b59fa885fbc6955cd3f0f2610f868be 100644 (file)
@@ -532,7 +532,7 @@ Value AExpression::OpObject(const AExpression* expr, const Dictionary::Ptr& loca
        }
 
        if (!checkName.IsEmpty()) {
-               ConfigItem::Ptr oldItem = ConfigItem::GetObject(type, name);
+               ConfigItem::Ptr oldItem = ConfigItem::GetObject(type, checkName);
 
                if (oldItem) {
                        std::ostringstream msgbuf;
index baaf0e5d7b025f2eb41cde219e8372ea652f4fb3..c1263a15f62b5fcf54a61c58c23b46c83416ba1a 100644 (file)
@@ -129,7 +129,7 @@ Dictionary::Ptr ConfigItem::GetProperties(void)
                        const DynamicObjectNameHelper *nh = dynamic_cast<const DynamicObjectNameHelper *>(Type::GetByName(m_Type));
 
                        if (nh) {
-                               String name = nh->MakeObjectName(m_Name, m_Properties);
+                               name = nh->MakeObjectName(m_Name, m_Properties);
 
                                if (name.IsEmpty())
                                        BOOST_THROW_EXCEPTION(std::runtime_error("Could not determine name for object"));