object-updater: Ignore ENOENT when trying to unlink stale pending files
Change-Id: Iaac1fb891d70707af38c567d9cca5913b8355b7d Closes-Bug: #1877924
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import six.moves.cPickle as pickle
|
import six.moves.cPickle as pickle
|
||||||
|
import errno
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
@@ -271,7 +272,11 @@ class ObjectUpdater(Daemon):
|
|||||||
if obj_hash == last_obj_hash:
|
if obj_hash == last_obj_hash:
|
||||||
self.stats.unlinks += 1
|
self.stats.unlinks += 1
|
||||||
self.logger.increment('unlinks')
|
self.logger.increment('unlinks')
|
||||||
|
try:
|
||||||
os.unlink(update_path)
|
os.unlink(update_path)
|
||||||
|
except OSError as e:
|
||||||
|
if e.errno != errno.ENOENT:
|
||||||
|
raise
|
||||||
else:
|
else:
|
||||||
last_obj_hash = obj_hash
|
last_obj_hash = obj_hash
|
||||||
yield {'device': device, 'policy': policy,
|
yield {'device': device, 'policy': policy,
|
||||||
|
|||||||
Reference in New Issue
Block a user