Fix empty module folder causing errors, fix var naming
Fix a wrongly named class causing ClassNotFound issues, also added additional checks for empty module folder and added en moduleFolder directive to configure module location refs #4092
This commit is contained in:
parent
5e5b301d0d
commit
d1f4e9831a
|
@ -3,6 +3,7 @@ environment = development
|
|||
timezone = "Europe/Berlin"
|
||||
indexModule = monitoring
|
||||
indexController = dashboard
|
||||
moduleFolder = "/usr/etc/icinga-modules"
|
||||
|
||||
[logging]
|
||||
; General log
|
||||
|
|
|
@ -100,7 +100,7 @@ abstract class ApplicationBootstrap
|
|||
public function moduleManager()
|
||||
{
|
||||
if ($this->moduleManager === null) {
|
||||
$this->moduleManager = new ModuleManager($this, "/etc/icinga2/modules_enabled");
|
||||
$this->moduleManager = new ModuleManager($this, $this->config->global->moduleFolder);
|
||||
}
|
||||
return $this->moduleManager;
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ class Manager
|
|||
|
||||
public function select()
|
||||
{
|
||||
$source = new \Icinga\Data\ArrayDataSource($this->getModuleInfo());
|
||||
$source = new \Icinga\Data\ArrayDatasource($this->getModuleInfo());
|
||||
return $source->select();
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,12 @@ class Manager
|
|||
public function getModuleInfo()
|
||||
{
|
||||
$installed = $this->listInstalledModules();
|
||||
|
||||
$info = array();
|
||||
if ($installed === null) {
|
||||
return $info;
|
||||
}
|
||||
|
||||
foreach ($installed as $name) {
|
||||
$info[] = (object) array(
|
||||
'name' => $name,
|
||||
|
@ -265,7 +270,10 @@ class Manager
|
|||
if ($this->installedBaseDirs === null) {
|
||||
$this->detectInstalledModules();
|
||||
}
|
||||
return array_keys($this->installedBaseDirs);
|
||||
|
||||
if ($this->installedBaseDirs !== null) {
|
||||
return array_keys($this->installedBaseDirs);
|
||||
}
|
||||
}
|
||||
|
||||
public function detectInstalledModules()
|
||||
|
|
|
@ -108,6 +108,5 @@
|
|||
containerMgrInstance = new ContainerMgr($,log,widgets,subTable);
|
||||
}
|
||||
return containerMgrInstance;
|
||||
|
||||
});
|
||||
})();
|
||||
|
|
|
@ -80,5 +80,3 @@ define([
|
|||
};
|
||||
return new Icinga();
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -24,4 +24,3 @@ define(['jquery','Holder'], function ($) {
|
|||
window.Icinga = Icinga;
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue