Example #1
0
        def _wait_for_horcm_execution(start_time, flag, *cmd, **kwargs):
            ignore_error = kwargs.pop('ignore_error', [])
            no_retry_error = ignore_error + _HORCM_NO_RETRY_ERRORS
            success_code = kwargs.pop('success_code', HORCM_EXIT_CODE)
            timeout = kwargs.pop('timeout', _EXEC_MAX_WAITTIME)
            horcmgr = kwargs.pop('horcmgr', _HORCMGR)
            do_login = kwargs.pop('do_login', False)

            result = utils.execute(*cmd, **kwargs)
            if _NOT_LOCKED in result[2] and not utils.check_timeout(
                    start_time, _LOCK_WAITTIME):
                LOG.debug(
                    "The resource group to which the operation object "
                    "belongs is being locked by other software.")
                return
            if (result[0] in success_code or
                    utils.check_timeout(start_time, timeout) or
                    utils.check_ignore_error(no_retry_error, result[2])):
                raise loopingcall.LoopingCallDone(result)
            if result[0] == EX_ENAUTH:
                if not self._retry_login(flag['ignore_enauth'], do_login):
                    raise loopingcall.LoopingCallDone(result)
                flag['ignore_enauth'] = False
            elif result[0] in _HORCM_ERROR:
                if not self._start_horcmgr(horcmgr):
                    raise loopingcall.LoopingCallDone(result)
            elif result[0] not in _COMMAND_IO_TO_RAID:
                raise loopingcall.LoopingCallDone(result)
Example #2
0
 def _wait_for_ldev_status(start_time, ldev, *args):
     result = self.run_raidcom(
         'get', 'ldev', '-ldev_id', ldev, *args, do_raise=False)
     if not result[0]:
         raise loopingcall.LoopingCallDone()
     if utils.check_timeout(start_time, _LDEV_STATUS_WAITTIME):
         raise loopingcall.LoopingCallDone(False)
Example #3
0
 def _wait_for_full_copy_pair_status(start_time, ldev,
                                     status, **kwargs):
     timeout = kwargs.pop('timeout', utils.DEFAULT_PROCESS_WAITTIME)
     if self._run_pairevtwait(ldev) in status:
         raise loopingcall.LoopingCallDone()
     if utils.check_timeout(start_time, timeout):
         raise loopingcall.LoopingCallDone(False)
Example #4
0
 def _wait_for_horcm_shutdown(start_time, inst):
     if _run_horcmgr(inst) != _HORCM_RUNNING:
         raise loopingcall.LoopingCallDone()
     if (_run_horcmshutdown(inst) and
             _run_horcmgr(inst) == _HORCM_RUNNING or
             utils.check_timeout(
                 start_time, utils.DEFAULT_PROCESS_WAITTIME)):
         raise loopingcall.LoopingCallDone(False)
Example #5
0
 def _wait_for_thin_copy_smpl(start_time, ldev, **kwargs):
     timeout = kwargs.pop('timeout', utils.DEFAULT_PROCESS_WAITTIME)
     ldev_info = self.get_ldev_info(
         ['sts', 'vol_attr'], '-ldev_id', ldev)
     if (ldev_info['sts'] != NORMAL_STS or
             THIN_ATTR not in ldev_info['vol_attr']):
         raise loopingcall.LoopingCallDone()
     if utils.check_timeout(start_time, timeout):
         raise loopingcall.LoopingCallDone(False)
Example #6
0
 def _wait_for_thin_copy_status(start_time, ldev, status, **kwargs):
     timeout = kwargs.pop('timeout', utils.DEFAULT_PROCESS_WAITTIME)
     if self._get_thin_copy_svol_status(ldev) == status:
         raise loopingcall.LoopingCallDone()
     if utils.check_timeout(start_time, timeout):
         raise loopingcall.LoopingCallDone(False)