Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/nova/cmd/manage.py b/nova/cmd/manage.py
- index 4c0d186..b839e77 100644
- --- a/nova/cmd/manage.py
- +++ b/nova/cmd/manage.py
- @@ -720,50 +720,51 @@ class DbCommands(object):
- "from table '%(table_name)s'.") %
- {'records': records, 'table_name': table_name})
- else:
- print(_("There are %(records)d records in the "
- "'%(table_name)s' table where the uuid or "
- "instance_uuid column is NULL. Run this "
- "command again with the --delete option after you "
- "have backed up any necessary data.") %
- {'records': records, 'table_name': table_name})
- # check to see if we didn't find anything
- if not records_found:
- print(_('There were no records found where '
- 'instance_uuid was NULL.'))
- def _run_migration(self, ctxt, max_count):
- ran = 0
- migrations = {}
- for migration_meth in self.online_migrations:
- count = max_count - ran
- try:
- found, done = migration_meth(ctxt, count)
- except Exception:
- print(_("Error attempting to run %(method)s") % dict(
- method=migration_meth))
- found = done = 0
- + raise
- name = migration_meth.__name__
- if found:
- print(_('%(total)i rows matched query %(meth)s, %(done)i '
- 'migrated') % {'total': found,
- 'meth': name,
- 'done': done})
- migrations.setdefault(name, (0, 0))
- migrations[name] = (migrations[name][0] + found,
- migrations[name][1] + done)
- if max_count is not None:
- ran += done
- if ran >= max_count:
- break
- return migrations
- @args('--max-count', metavar='<number>', dest='max_count',
- help='Maximum number of objects to consider')
- def online_data_migrations(self, max_count=None):
- ctxt = context.get_admin_context()
- if max_count is not None:
- try:
- max_count = int(max_count)
- except ValueError:
- max_count = -1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement