[icinga-checkins] icinga.org: icingaweb2/master: Present the fact that Icinga Web 2' s config directory isn't readable in a nicer way

git at icinga.org git at icinga.org
Thu Feb 25 17:36:16 CET 2016


Module: icingaweb2
Branch: master
Commit: 1aada1abbb5334d7e7e8940f59cbfd700ddb42ce
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=1aada1abbb5334d7e7e8940f59cbfd700ddb42ce

Author: Alexander A. Klimov <alexander.klimov at netways.de>
Date:   Thu Feb 25 17:31:09 2016 +0100

Present the fact that Icinga Web 2's config directory isn't readable in a nicer way

fixes #11119

---

 library/Icinga/Cli/Loader.php |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/library/Icinga/Cli/Loader.php b/library/Icinga/Cli/Loader.php
index 0f7d250..14a387a 100644
--- a/library/Icinga/Cli/Loader.php
+++ b/library/Icinga/Cli/Loader.php
@@ -5,6 +5,7 @@ namespace Icinga\Cli;
 
 use Icinga\Application\ApplicationBootstrap as App;
 use Icinga\Exception\IcingaException;
+use Icinga\Exception\NotReadableError;
 use Icinga\Exception\ProgrammingError;
 use Icinga\Cli\Params;
 use Icinga\Cli\Screen;
@@ -421,10 +422,14 @@ class Loader
     {
         if ($this->modules === null) {
             $this->modules = array();
-            $this->modules = array_unique(array_merge(
-                $this->app->getModuleManager()->listEnabledModules(),
-                $this->app->getModuleManager()->listLoadedModules()
-            ));
+            try {
+                $this->modules = array_unique(array_merge(
+                    $this->app->getModuleManager()->listEnabledModules(),
+                    $this->app->getModuleManager()->listLoadedModules()
+                ));
+            } catch (NotReadableError $e) {
+                $this->fail($e->getMessage());
+            }
         }
         return $this->modules;
     }



More information about the icinga-checkins mailing list