Commit 32ecb1b5 authored by Antoine Millet's avatar Antoine Millet
Browse files

Cleaned useless _check_status method on migration jobs

parent 06bcbfd0
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -167,14 +167,6 @@ class ColdMigrationJob(BaseJob):
        if checksums[0] != checksums[1]:
            raise JobCancelError('checksum mismatches')

    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 cancel(self):
        if self.get('func_cancel_xfer') is not None:
            self.get('func_cancel_xfer')()
+3 −9
Original line number Diff line number Diff line
@@ -62,8 +62,9 @@ class HotMigrationJob(BaseJob):

            before_clone_autostart = vm['autostart'].lower() == 'yes'

            if not self._check_status(vm_id, 'running'):
                raise JobCancelError('vm is not started')

            if not vm['status'] == 'running':
                raise JobCancelError('vm is not stopped')

            to_cleanup = []

@@ -220,10 +221,3 @@ class HotMigrationJob(BaseJob):

        return to_cleanup
    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)