]> granicus.if.org Git - icinga2/commitdiff
Add Log Warning in case active-stage is empty
authorJean Flach <jean-marcel.flach@icinga.com>
Wed, 20 Sep 2017 15:57:14 +0000 (17:57 +0200)
committerJean Flach <jean-marcel.flach@icinga.com>
Wed, 20 Sep 2017 15:57:14 +0000 (17:57 +0200)
Maybe Critical instead? Throwing an exception seems unnecessary.

refs #3668

lib/remote/configpackageutility.cpp

index b7f04a18fca2ec81e877fdc28b6b265836ea09da..e0b88aa8e958429fb41a371954ada7062cb61402 100644 (file)
@@ -254,7 +254,11 @@ String ConfigPackageUtility::GetActiveStage(const String& packageName)
        fp.close();
 
        if (fp.fail())
-               return "";
+               stage = "";
+
+       if (stage.IsEmpty())
+               Log(LogWarning, "ConfigPackageUtility")
+                       << "Could not determinate the active stage, does \"" << path << "\" exist?";
 
        return stage.Trim();
 }