diff options
author | imacdonn <iain.macdonnell@oracle.com> | 2018-09-26 04:30:49 +0000 |
---|---|---|
committer | Matt Riedemann <mriedem.os@gmail.com> | 2018-09-27 14:57:09 -0400 |
commit | d8b99f05abb2fa8964a326958804f47daf95da64 (patch) | |
tree | d1301b0f3ddbae2c8038026bc602b1f9e2c8f3e2 /nova/cmd | |
parent | f5868cbc9d403ad5fed2bc4d44289c28d274d7fe (diff) | |
download | nova-d8b99f05abb2fa8964a326958804f47daf95da64.tar.gz |
nova-manage - fix online_data_migrations counts
When running online_data_migrations in batches, totals were not
being accumulated - rather the counts each batch would clobber
those from the previous one, and the last batch would run no
migrations, so the totals were reported as zero.
Change-Id: Ib616f2efb69baa16e18601d27b747220bbefeb16
Closes-Bug: #1794364
(cherry picked from commit c4c6dc736e084f2d919b9bcf93d26df87e0341c9)
(cherry picked from commit fc9c8772012b528176c3f58d99a58491bb1aedb4)
Diffstat (limited to 'nova/cmd')
-rw-r--r-- | nova/cmd/manage.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/nova/cmd/manage.py b/nova/cmd/manage.py index c214161e4b..85908b39f5 100644 --- a/nova/cmd/manage.py +++ b/nova/cmd/manage.py @@ -617,9 +617,7 @@ Error: %s""") % six.text_type(e)) 'migrated') % {'total': found, 'meth': name, 'done': done}) - migrations.setdefault(name, (0, 0)) - migrations[name] = (migrations[name][0] + found, - migrations[name][1] + done) + migrations[name] = found, done if max_count is not None: ran += done if ran >= max_count: @@ -648,8 +646,14 @@ Error: %s""") % six.text_type(e)) migration_info = {} while ran is None or ran != 0: migrations = self._run_migration(ctxt, max_count) - migration_info.update(migrations) - ran = sum([done for found, done in migrations.values()]) + ran = 0 + for name in migrations: + migration_info.setdefault(name, (0, 0)) + migration_info[name] = ( + migration_info[name][0] + migrations[name][0], + migration_info[name][1] + migrations[name][1], + ) + ran += migrations[name][1] if not unlimited: break |