CoreApi: do not wipe uncollected stages

This commit is contained in:
Thomas Gelf 2016-03-20 18:45:38 +01:00
parent 6c23cd72e5
commit d27c8a9948
1 changed files with 5 additions and 1 deletions

View File

@ -439,10 +439,14 @@ constants
return $found;
}
public function wipeInactiveStages()
public function wipeInactiveStages($db)
{
$uncollected = $db->getUncollectedDeployments();
$moduleName = 'director';
foreach ($this->listModuleStages($moduleName, false) as $stage) {
if (array_key_exists($stage, $uncollected)) {
continue;
}
$this->client->delete('config/stages/' . $moduleName . '/' . $stage);
}
}