def check_already_managed_volume(vol_id):
 try:
  return (vol_id and isinstance(vol_id, six.string_types) and uuid.UUID(vol_id, version=4) and objects.Volume.exists(context.get_admin_context(), vol_id))
 except ValueError:
  return False

def check_already_managed_volume ( vol_id ) : try : return ( vol_id and isinstance ( vol_id , six . string_types ) and uuid . UUID ( vol_id , version = 4 ) and objects . Volume . exists ( context . get_admin_context ( ) , vol_id ) ) except ValueError : return False
check cinder db for already managed volume .