]> granicus.if.org Git - icinga2/commitdiff
Zone#OnAllConfigLoaded(): warn on zones in zones feature/zone-in-zone-sin-7530 7545/head
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Fri, 27 Sep 2019 14:09:27 +0000 (16:09 +0200)
committerAlexander A. Klimov <alexander.klimov@icinga.com>
Fri, 27 Sep 2019 14:10:03 +0000 (16:10 +0200)
refs #7530

lib/remote/zone.cpp

index 5ae1468c16903449d534bd81f76910c660be513f..71a9294f18e9d128bd1cc174f7fb7fb3550e0ff7 100644 (file)
@@ -44,6 +44,16 @@ void Zone::OnAllConfigLoaded()
                if (levels > 32)
                        BOOST_THROW_EXCEPTION(ScriptError("Infinite recursion detected while resolving zone graph. Check your zone hierarchy.", GetDebugInfo()));
        }
+
+       {
+               auto zone (GetZone());
+
+               if (zone) {
+                       Log(LogWarning, "config")
+                               << "Zone '" << GetName() << "' resides in zone '" << zone->GetName() << "' " << GetDebugInfo() << "."
+                               " Please move it outside any zone.";
+               }
+       }
 }
 
 Zone::Ptr Zone::GetParent() const