@require_context
def volume_encryption_metadata_get(context, volume_id, session=None):
 volume_ref = _volume_get(context, volume_id)
 encryption_ref = volume_type_encryption_get(context, volume_ref['volume_type_id'])
 values = {'encryption_key_id': volume_ref['encryption_key_id']}
 if encryption_ref:
  for key in ['control_location', 'cipher', 'key_size', 'provider']:
   values[key] = encryption_ref[key]
 return values

@ require_context def volume_encryption_metadata_get ( context , volume_id , session = None ) : volume_ref = _volume_get ( context , volume_id ) encryption_ref = volume_type_encryption_get ( context , volume_ref [ 'volume_type_id' ] ) values = { 'encryption_key_id' : volume_ref [ 'encryption_key_id' ] } if encryption_ref : for key in [ 'control_location' , 'cipher' , 'key_size' , 'provider' ] : values [ key ] = encryption_ref [ key ] return values
return the encryption metadata for a given volume .