From 70eabe29c59a003e296fa9ee9ffbb157682e4755 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 12 Mar 2013 00:50:16 -0700 Subject: [PATCH] [FileBackend] Suppress missing container errors with "ignoreMissingSource". Change-Id: I2b9f4764c4938dcee61f17c31ed4d4b84fbfbcb2 --- includes/filebackend/SwiftFileBackend.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index 6357b86312..0f3d97a310 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -411,7 +411,9 @@ class SwiftFileBackend extends FileBackendStore { $sContObj = $this->getContainer( $srcCont ); $dContObj = $this->getContainer( $dstCont ); } catch ( NoSuchContainerException $e ) { - $status->fatal( 'backend-fail-copy', $params['src'], $params['dst'] ); + if ( empty( $params['ignoreMissingSource'] ) || isset( $sContObj ) ) { + $status->fatal( 'backend-fail-copy', $params['src'], $params['dst'] ); + } return $status; } catch ( CloudFilesException $e ) { // some other exception? $this->handleException( $e, $status, __METHOD__, $params ); @@ -481,7 +483,9 @@ class SwiftFileBackend extends FileBackendStore { $sContObj = $this->getContainer( $srcCont ); $dContObj = $this->getContainer( $dstCont ); } catch ( NoSuchContainerException $e ) { - $status->fatal( 'backend-fail-move', $params['src'], $params['dst'] ); + if ( empty( $params['ignoreMissingSource'] ) || isset( $sContObj ) ) { + $status->fatal( 'backend-fail-move', $params['src'], $params['dst'] ); + } return $status; } catch ( CloudFilesException $e ) { // some other exception? $this->handleException( $e, $status, __METHOD__, $params ); @@ -557,7 +561,9 @@ class SwiftFileBackend extends FileBackendStore { } catch ( CDNNotEnabledException $e ) { // CDN not enabled; nothing to see here } catch ( NoSuchContainerException $e ) { - $status->fatal( 'backend-fail-delete', $params['src'] ); + if ( empty( $params['ignoreMissingSource'] ) ) { + $status->fatal( 'backend-fail-delete', $params['src'] ); + } } catch ( NoSuchObjectException $e ) { if ( empty( $params['ignoreMissingSource'] ) ) { $status->fatal( 'backend-fail-delete', $params['src'] ); -- 2.20.1