compute: split check_can_live_migrate_destination

We'll want to add claims around the logic of this method, so it's better
if there is a nested method that does the business logic to
avoid deep nesting that makes the code less readable.

Related-bug: 1417667
Change-Id: I8c2f1a67846fe27dbe350a288d7e9be6be109b90
This commit is contained in:
Nikola Dipanov 2015-10-16 14:51:39 +01:00
parent bc2eacf732
commit 0bb21d5173
1 changed files with 7 additions and 0 deletions

View File

@ -4998,6 +4998,13 @@ class ComputeManager(manager.Manager):
:param disk_over_commit: if true, allow disk over commit
:returns: a dict containing migration info
"""
return self._do_check_can_live_migrate_destination(ctxt, instance,
block_migration,
disk_over_commit)
def _do_check_can_live_migrate_destination(self, ctxt, instance,
block_migration,
disk_over_commit):
src_compute_info = obj_base.obj_to_primitive(
self._get_compute_info(ctxt, instance.host))
dst_compute_info = obj_base.obj_to_primitive(