Merge "Cinder Backup: object_count value incorrect"

This commit is contained in:
Zuul 2018-10-19 03:33:56 +00:00 committed by Gerrit Code Review
commit 7f39a12f7c
2 changed files with 7 additions and 6 deletions

View File

@ -427,7 +427,12 @@ class ChunkedBackupDriver(driver.BackupDriver):
object_list,
volume_meta,
extra_metadata)
backup.object_count = object_id
# NOTE(whoami-rajat) : The object_id variable is used to name
# the backup objects and hence differs from the object_count
# variable, therefore the increment of object_id value in the last
# iteration of _backup_chunk() method shouldn't be reflected in the
# object_count variable.
backup.object_count = object_id - 1
backup.save()
LOG.debug('backup %s finished.', backup['id'])

View File

@ -397,11 +397,7 @@ class ChunkedDriverTestCase(test.TestCase):
object_meta,
object_sha256)
# TODO(smcginnis): Object count is either misnamed or we use it in an
# odd way. We increment the object count from 1, so writing one chunk
# results in an object count of 2. Should probably straighten that out
# at some point.
self.assertEqual(2, self.backup.object_count)
self.assertEqual(1, self.backup.object_count)
def test_backup_metadata(self):
object_meta = {}