]> granicus.if.org Git - icinga2/commitdiff
Make sure the CGIs don't croak on our objects.cache file.
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 2 Jul 2013 06:52:47 +0000 (08:52 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 2 Jul 2013 06:52:47 +0000 (08:52 +0200)
components/compat/compatcomponent.cpp

index 0a6687c66cd5b24b01fd10dd187d80c3ee42dfa1..ba108d589073966f6adfc5ecc092b05b38d03af7 100644 (file)
@@ -232,7 +232,8 @@ void CompatComponent::DumpComments(std::ostream& fp, const Service::Ptr& owner,
 void CompatComponent::DumpTimePeriod(std::ostream& fp, const TimePeriod::Ptr& tp)
 {
        fp << "define timeperiod {" << "\n"
-          << "\t" << "timeperiod_name" << "\t" << tp->GetName() << "\n";
+          << "\t" << "timeperiod_name" << "\t" << tp->GetName() << "\n"
+          << "\t" << "alias" << "\t" << tp->GetName() << "\n";
 
        Dictionary::Ptr ranges = tp->Get("ranges");
 
@@ -267,8 +268,10 @@ void CompatComponent::DumpCommand(std::ostream& fp, const Command::Ptr& command)
                        // This is obviously incorrect for non-trivial cases.
                        fp << " \"" << arg << "\"";
                }
+       } else if (!commandLine.IsEmpty()) {
+               fp << Convert::ToString(commandLine);
        } else {
-               fp << Convert::ToString(commandLine) << "\n";
+               fp << "<internal>";
        }
 
        fp << "\n";