migrate: Don't fail dashboard migration just because a locale is missing

This commit is contained in:
Johannes Meyer 2019-08-02 12:00:26 +02:00
parent 861c5601b6
commit 49e84f2ad0
1 changed files with 7 additions and 1 deletions

View File

@ -9,6 +9,7 @@ use Icinga\Application\Icinga;
use Icinga\Application\Modules\DashboardContainer; use Icinga\Application\Modules\DashboardContainer;
use Icinga\Cli\Command; use Icinga\Cli\Command;
use Icinga\Application\Logger; use Icinga\Application\Logger;
use Icinga\Exception\IcingaException;
use Icinga\Util\Translator; use Icinga\Util\Translator;
use ReflectionClass; use ReflectionClass;
@ -58,7 +59,12 @@ class DashboardCommand extends Command
continue; continue;
} }
try {
Translator::setupLocale($locale); Translator::setupLocale($locale);
} catch (IcingaException $e) {
Logger::debug('Ignoring locale "%s". Reason: %s', $locale, $e->getMessage());
continue;
}
foreach ($paneItemsProperty->getValue($module) as $paneName => $container) { foreach ($paneItemsProperty->getValue($module) as $paneName => $container) {
/** @var DashboardContainer $container */ /** @var DashboardContainer $container */