'Create host entry on ISE for connector'

def _create_host(self, hostname, endpoints):

    endpoint_str = ''
    if (type(endpoints) is list):
        ep_str = []
        ec = 0
        for endpoint in endpoints:
            if (ec == 0):
                ep_str.append(('%s' % endpoint))
            else:
                ep_str.append(('endpoint=%s' % endpoint))
            ec += 1
        endpoint_str = '&'.join(ep_str)
    else:
        endpoint_str = endpoints
    LOG.debug('Create    host    %(host)s;    %(endpoint)s', {'host': hostname, 'endpoint': endpoint_str})
    params = {'name': hostname, 'endpoint': endpoint_str, 'os': 'openstack'}
    url = ('/storage/arrays/%s/hosts' % self._get_ise_globalid())
    resp = self._send_cmd('POST', url, params)
    status = resp['status']
    if ((status != 201) and (status != 409)):
        LOG.error('POST    for    host    create    failed    (%s)!', status)
        RaiseXIODriverException()
    return hostname
