'Run an XG request function, retry if needed, and verify success.
If the verification fails, then retry the request/verify cycle
until both functions are successful, the request function
returns a failure message, or the global request timeout is
hit.
This wrapper is meant to deal with backend requests that can
fail for any variety of reasons, for instance, when the system
is already busy handling other LUN requests.  It is also smart
enough to give up if clustering is down (eg no HA available),
there is no space left, or other "fatal" errors are returned
(see _fatal_error_code() for a list of all known error
conditions).
:param request_func:  XG api method to call
:param verify_func:  function call to verify request was completed
:param request_success_msg:  Success message expected for request_func
:param *rargs:  argument array to be passed to request_func
:param *vargs:  argument array to be passed to verify_func
:returns: the response dict from the last XG call'

def _send_cmd_and_verify(self, request_func, verify_func, request_success_msgs='', rargs=None, vargs=None):

    resp = {}
    start = time.time()
    request_needed = True
    verify_needed = True
    if isinstance(request_success_msgs, six.string_types):
        request_success_msgs = [request_success_msgs]
    rargs = (rargs if rargs else [])
    vargs = (vargs if vargs else [])
    while (request_needed or verify_needed):
        if ((time.time() - start) >= self.config.violin_request_timeout):
            raise exception.ViolinRequestRetryTimeout(timeout=self.config.violin_request_timeout)
        if request_needed:
            resp = request_func(*rargs)
            if (not resp['msg']):
                resp['msg'] = ''
            for msg in request_success_msgs:
                if (resp['success'] and (msg in resp['msg'])):
                    request_needed = False
                    break
            if (not resp['success']):
                self._check_error_code(resp)
                request_needed = False
        elif verify_needed:
            success = verify_func(*vargs)
            if success:
                verify_needed = False
    return resp
