'Safely handle a return code of BLOCKED from a cluster command.
Handle the case where a command is in BLOCKED state by trying to
cancel it.  If the cancel fails, then the command actually did
complete.  If the cancel succeeds, then throw the original error
back up the stack.'

def _handle_blocked(self, err, msg):

    if ((err.stdout is not None) and (self.BLOCKED in err.stdout)):
        request = err.stdout.split('\n', 1)[0].strip()
        params = [self.VGCCLUSTER, 'request-cancel']
        params += ['-r', six.text_type(request)]
        throw_err = False
        try:
            self._execute(run_as_root=True, *params)
            LOG.error('VGC-CLUSTER    command    blocked    and    cancelled.')
            throw_err = True
        except Exception:
            pass
        if throw_err:
            self._log_cli_err(err)
            msg = (_('Command    %(cmd)s    blocked    in    the    CLI    and    was    cancelled') % {'cmd': six.text_type(err.cmd)})
            raise exception.VolumeDriverException(message=msg)
    else:
        self._log_cli_err(err)
        raise exception.VolumeDriverException(message=msg)
