From: Marcin Haba Date: Sat, 2 Feb 2019 05:32:29 +0000 (+0100) Subject: baculum: Use new bvfs cleanup endpoint X-Git-Tag: Release-9.4.2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c2e46871d931af41bc96832b5bcb80441f7a77f;p=thirdparty%2Fbacula.git baculum: Use new bvfs cleanup endpoint --- diff --git a/gui/baculum/protected/API/Pages/API/RestoreRun.php b/gui/baculum/protected/API/Pages/API/RestoreRun.php index b01d138c3..31ff347d9 100644 --- a/gui/baculum/protected/API/Pages/API/RestoreRun.php +++ b/gui/baculum/protected/API/Pages/API/RestoreRun.php @@ -115,35 +115,8 @@ class RestoreRun extends BaculumAPIServer { $command[] = 'yes'; $restore = $this->getModule('bconsole')->bconsoleCommand($this->director, $command); - $this->removeTmpRestoreTable($rfile); $this->output = $restore->output; $this->error = $restore->exitcode; } - - private function removeTmpRestoreTable($tableName) { - $misc = $this->getModule('misc'); - if (preg_match($misc::RPATH_PATTERN, $tableName) === 1) { - // @TODO: Move it to API module. It shouldn't look like here. - $db_params = $this->getModule('api_config')->getConfig('db'); - $connection = APIDbModule::getAPIDbConnection($db_params); - $connection->setActive(true); - $sql = "DROP TABLE $tableName"; - $pdo = $connection->getPdoInstance(); - try { - $pdo->exec($sql); - } catch(PDOException $e) { - $emsg = 'Problem during delete temporary Bvfs table. ' . $e->getMessage(); - $this->getModule('logging')->log( - __FUNCTION__, - $emsg, - Logging::CATEGORY_APPLICATION, - __FILE__, - __LINE__ - ); - } - $pdo = null; - } - } } - ?> diff --git a/gui/baculum/protected/Web/Pages/RestoreWizard.php b/gui/baculum/protected/Web/Pages/RestoreWizard.php index ecb4cda8c..941d2a8b9 100644 --- a/gui/baculum/protected/Web/Pages/RestoreWizard.php +++ b/gui/baculum/protected/Web/Pages/RestoreWizard.php @@ -813,6 +813,8 @@ class RestoreWizard extends BaculumWebPage $ret = $this->getModule('api')->create(array('jobs', 'restore'), $restore_props); $jobid = $this->getModule('misc')->findJobIdStartedJob($ret->output); + // Remove temporary BVFS table + $this->getModule('api')->set(array('bvfs', 'cleanup'), array('path' => $path)); } $url_params = array(); if (is_numeric($jobid)) {