Commit 919a6926 authored by Antoine Millet's avatar Antoine Millet

Added a base class for migration jobs.

parent 7e1dd555
......@@ -243,7 +243,22 @@ class KillOldCliJob(BaseJob):
time.sleep(delay)
class ColdMigrationJob(BaseJob):
class BaseMigrationJob(BaseJob):
'''
Base class for migration jobs.
'''
def _check_status(self, vm_id, status):
'''
Check the status of the VM.
'''
answer = self.manager.server.list('id=%s&status=%s' % (vm_id, status))
return bool(answer)
class ColdMigrationJob(BaseMigrationJob):
'''
A cold vm migration job.
......@@ -362,13 +377,6 @@ class ColdMigrationJob(BaseJob):
logging.info('Job-%s: Migration completed with success', self['id'])
def _check_status(self, vm_id, status):
'''
Check the status of the VM.
'''
answer = self.manager.server.list('id=%s&status=%s' % (vm_id, status))
return bool(answer)
def _copy_disk(self, source, dest, vm, disk):
'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment