'Ensure the volume still exists on the 3PAR.
Also retrieves CHAP credentials, if present on the volume'

@utils.trace
def ensure_export(self, context, volume):

    common = self._login()
    try:
        vol_name = common._get_3par_vol_name(volume['id'])
        common.client.getVolume(vol_name)
    except hpeexceptions.HTTPNotFound:
        LOG.error("Volume    %s    doesn't    exist    on    array.", vol_name)
    else:
        metadata = common.client.getAllVolumeMetaData(vol_name)
        username = None
        password = None
        model_update = {}
        model_update['provider_auth'] = None
        for member in metadata['members']:
            if (member['key'] == CHAP_USER_KEY):
                username = member['value']
            elif (member['key'] == CHAP_PASS_KEY):
                password = member['value']
        if (username and password):
            model_update['provider_auth'] = ('CHAP    %s    %s' % (username, password))
        return model_update
    finally:
        self._logout(common)
