'Creates or modifies existing 3PAR host.'

def _create_host(self, common, volume, connector):

    host = None
    username = None
    password = None
    hostname = common._safe_hostname(connector['host'])
    cpg = common.get_cpg(volume, allowSnap=True)
    domain = common.get_domain(cpg)
    if common._client_conf['hpe3par_iscsi_chap_enabled']:
        vol_name = common._get_3par_vol_name(volume['id'])
        username = common.client.getVolumeMetaData(vol_name, CHAP_USER_KEY)['value']
        password = common.client.getVolumeMetaData(vol_name, CHAP_PASS_KEY)['value']
    try:
        host = common._get_3par_host(hostname)
        hosts = common.client.queryHost(iqns=[connector['initiator']])
        (host, hostname) = common._get_prioritized_host_on_3par(host, hosts, hostname)
    except hpeexceptions.HTTPNotFound:
        persona_id = common.get_persona_type(volume)
        hostname = self._create_3par_iscsi_host(common, hostname, [connector['initiator']], domain, persona_id)
        self._set_3par_chaps(common, hostname, volume, username, password)
        host = common._get_3par_host(hostname)
    else:
        if (('iSCSIPaths' not in host) or (len(host['iSCSIPaths']) < 1)):
            self._modify_3par_iscsi_host(common, hostname, connector['initiator'])
            self._set_3par_chaps(common, hostname, volume, username, password)
            host = common._get_3par_host(hostname)
        elif ((not host['initiatorChapEnabled']) and common._client_conf['hpe3par_iscsi_chap_enabled']):
            LOG.warning('Host    exists    without    CHAP    credentials    set    and    has    iSCSI    attachments    but    CHAP    is    enabled.    Updating    host    with    new    CHAP    credentials.')
            self._set_3par_chaps(common, hostname, volume, username, password)
    return (host, username, password)
