mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
Merge pull request #2757 from Icinga/bugfix/icingacli-module-disable-fails-2714
CLI: don't fail to disable an already disabled module
This commit is contained in:
commit
c64c6ee0b9
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
namespace Icinga\Clicommands;
|
namespace Icinga\Clicommands;
|
||||||
|
|
||||||
|
use Icinga\Application\Logger;
|
||||||
|
use Icinga\Application\Modules\Manager;
|
||||||
use Icinga\Cli\Command;
|
use Icinga\Cli\Command;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -14,6 +16,9 @@ use Icinga\Cli\Command;
|
|||||||
*/
|
*/
|
||||||
class ModuleCommand extends Command
|
class ModuleCommand extends Command
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @var Manager
|
||||||
|
*/
|
||||||
protected $modules;
|
protected $modules;
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
@ -109,7 +114,12 @@ class ModuleCommand extends Command
|
|||||||
if (! $module || $this->hasRemainingParams()) {
|
if (! $module || $this->hasRemainingParams()) {
|
||||||
return $this->showUsage();
|
return $this->showUsage();
|
||||||
}
|
}
|
||||||
$this->modules->disableModule($module);
|
|
||||||
|
if ($this->modules->hasEnabled($module)) {
|
||||||
|
$this->modules->disableModule($module);
|
||||||
|
} else {
|
||||||
|
Logger::info('Module "%s" is already disabled', $module);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user