def rax_find_volume(module, rax_module, name):
 cbs = rax_module.cloud_blockstorage
 try:
  UUID(name)
  volume = cbs.get(name)
 except ValueError:
  try:
   volume = cbs.find(name=name)
  except rax_module.exc.NotFound:
   volume = None
  except Exception as e:
   module.fail_json(msg=('%s' % e))
 return volume

def rax_find_volume ( module , rax_module , name ) : cbs = rax_module . cloud_blockstorage try : UUID ( name ) volume = cbs . get ( name ) except ValueError : try : volume = cbs . find ( name = name ) except rax_module . exc . NotFound : volume = None except Exception as e : module . fail_json ( msg = ( '%s' % e ) ) return volume
find a block storage volume by id or name .