Fix migrating navigation items only for the given user doesn't work

This commit is contained in:
Yonas Habteab 2021-12-07 17:42:21 +01:00 committed by Johannes Meyer
parent 1d98c8cc3d
commit 354099b4e2
1 changed files with 2 additions and 2 deletions

View File

@ -50,10 +50,11 @@ class NavigationCommand extends Command
}
$rc = 0;
$username = $this->params->get('user');
$user = $this->params->get('user');
$directories = new DirectoryIterator($preferencesPath);
foreach ($directories as $directory) {
$username = $user;
if ($username !== null && $directories->key() !== $username) {
continue;
}
@ -66,7 +67,6 @@ class NavigationCommand extends Command
$serviceActions = $this->readFromIni($directory . '/service-actions.ini', $rc);
Logger::info('Migrating monitoring navigation items for user "%s" to the Icinga DB Web actions', $username);
$username = null;
if (! $hostActions->isEmpty()) {
$this->migrateNavigationItems($hostActions, $directory . '/icingadb-host-actions.ini', $rc);