'Gets the associated account, generates CHAP info and updates.'

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

    model_update = {}
    if (not common._client_conf['hpe3par_iscsi_chap_enabled']):
        model_update['provider_auth'] = None
        return model_update
    chap_username = connector['host']
    chap_password = None
    try:
        vluns = common.client.getHostVLUNs(chap_username)
        host_info = common.client.getHost(chap_username)
        if (not host_info['initiatorChapEnabled']):
            LOG.warning('Host    has    no    CHAP    key,    but    CHAP    is    enabled.')
    except hpeexceptions.HTTPNotFound:
        chap_password = volume_utils.generate_password(16)
        LOG.warning('No    host    or    VLUNs    exist.    Generating    new    CHAP    key.')
    else:
        chap_exists = False
        active_vluns = 0
        for vlun in vluns:
            if (not vlun['active']):
                continue
            active_vluns += 1
            if (('remoteName' in vlun) and re.match('iqn.*', vlun['remoteName'])):
                try:
                    chap_password = common.client.getVolumeMetaData(vlun['volumeName'], CHAP_PASS_KEY)['value']
                    chap_exists = True
                    break
                except hpeexceptions.HTTPNotFound:
                    LOG.debug('The    VLUN    %s    is    missing    CHAP    credentials    but    CHAP    is    enabled.    Skipping.', vlun['remoteName'])
            else:
                LOG.warning('Non-iSCSI    VLUN    detected.')
        if (not chap_exists):
            chap_password = volume_utils.generate_password(16)
            LOG.warning('No    VLUN    contained    CHAP    credentials.    Generating    new    CHAP    key.')
    vol_name = common._get_3par_vol_name(volume['id'])
    common.client.setVolumeMetaData(vol_name, CHAP_USER_KEY, chap_username)
    common.client.setVolumeMetaData(vol_name, CHAP_PASS_KEY, chap_password)
    model_update['provider_auth'] = ('CHAP    %s    %s' % (chap_username, chap_password))
    return model_update
