Package ganeti :: Package utils :: Module bitarrays
[hide private]
[frames] | no frames]

Module bitarrays

source code

Utility functions for managing bitarrays.

Functions [hide private]
 
GetFreeSlot(slots, slot=None, reserve=False)
Helper method to get first available slot in a bitarray
source code
Variables [hide private]
  _AVAILABLE_SLOT = bitarray("0")

Imports: bitarray, errors


Function Details [hide private]

GetFreeSlot(slots, slot=None, reserve=False)

source code 

Helper method to get first available slot in a bitarray

Parameters:
  • slots (bitarray) - the bitarray to operate on
  • slot (integer) - if given we check whether the slot is free
  • reserve (boolean) - whether to reserve the first available slot or not
Returns:
the idx of the (first) available slot
Raises: