module documentation

Module implementing configuration details at runtime.

Class GetentResolver Resolves Ganeti uids and gids by name.
Function GetArchInfo Returns previsouly initialized architecture information.
Function GetClient Connects to the a luxi socket and returns a client.
Function GetEnts Singleton wrapper around resolver instance.
Function GetGid Retrieve the gid from the database.
Function GetUid Retrieve the uid from the database.
Function InitArchInfo Initialize architecture information.
Variable _arch Undocumented
Variable _priv Undocumented
Variable _priv_lock Undocumented
def GetArchInfo():

Returns previsouly initialized architecture information.

def GetClient():

Connects to the a luxi socket and returns a client.

def GetEnts(resolver=GetentResolver):

Singleton wrapper around resolver instance.

As this method is accessed by multiple threads at the same time we need to take thread-safety carefully.

def GetGid(group, _getgrnam):

Retrieve the gid from the database.

Parameters
group:stringThe group name to retrieve
_getgrnamUndocumented
Returns
The resolved gid
def GetUid(user, _getpwnam):

Retrieve the uid from the database.

Parameters
user:stringThe username to retrieve
_getpwnamUndocumented
Returns
The resolved uid
def InitArchInfo():

Initialize architecture information.

We can assume this information never changes during the lifetime of a process, therefore the information can easily be cached.

Note
This function uses platform.architecture to retrieve the Python binary architecture and does so by forking to run file (see Python documentation for more information). Therefore it must not be used in a multi-threaded environment.
_arch =

Undocumented

_priv =

Undocumented

_priv_lock =

Undocumented