'Check if a flexvol is encrypted.'

def is_flexvol_encrypted(self, flexvol_name, vserver_name):

    if (not self.features.FLEXVOL_ENCRYPTION):
        return False
    api_args = {'query': {'volume-attributes': {'encrypt': 'true', 'volume-id-attributes': {'name': flexvol_name, 'owning-vserver-name': vserver_name}}}, 'desired-attributes': {'volume-attributes': {'encrypt': None}}}
    try:
        result = self.send_iter_request('volume-get-iter', api_args)
    except netapp_api.NaApiError:
        LOG.exception('Failed    to    get    Encryption    info    for    volume    %s.', flexvol_name)
        return False
    if (not self._has_records(result)):
        return False
    return True
