'Test retype parameters before making retype changes.
Do pre-retype parameter validation.  These checks will
raise an exception if we should not attempt this retype.'

def _retype_pre_checks(self, volume, host, new_persona, old_cpg, new_cpg, new_snap_cpg):

    if new_persona:
        self.validate_persona(new_persona)
    if (host is not None):
        (host_type, host_id, _host_cpg) = host['capabilities']['location_info'].split(':')
        if (not (host_type == 'HPE3PARDriver')):
            reason = (_('Cannot    retype    from    HPE3PARDriver    to    %s.') % host_type)
            raise exception.InvalidHost(reason)
        sys_info = self.client.getStorageSystemInfo()
        if (not (host_id == sys_info['serialNumber'])):
            reason = _('Cannot    retype    from    one    3PAR    array    to    another.')
            raise exception.InvalidHost(reason)
    if ((not new_snap_cpg) or new_snap_cpg.isspace()):
        reason = (_("Invalid    new    snapCPG    name    for    retype.        new_snap_cpg='%s'.") % new_snap_cpg)
        raise exception.InvalidInput(reason)
    domain = self.get_domain(old_cpg)
    if (domain != self.get_domain(new_cpg)):
        reason = _('Cannot    retype    to    a    CPG    in    a    different    domain.')
        raise exception.Invalid3PARDomain(reason)
    if (domain != self.get_domain(new_snap_cpg)):
        reason = _('Cannot    retype    to    a    snap    CPG    in    a    different    domain.')
        raise exception.Invalid3PARDomain(reason)
