x2gobroker.nameservices.libnss_nameservice module

class x2gobroker.nameservices.libnss_nameservice.X2GoBrokerNameService[source]

Bases: X2GoBrokerNameService

get_group_members(group, primary_groups=False)[source]

Retrieve a list of POSIX users being members of a given POSIX group.

Optionally, primary group memberships can be considered (or not).

Parameters:
  • group (str) – name of the group to retrieve members of

  • primary_groups (bool) – take primary group membership into consideration or not

Returns:

list of users that are members of the given group

Return type:

list

get_groups()[source]

Retrieve list of groups from the POSIX nameservices system.

Returns:

list of known group names

Return type:

list

get_primary_group(username)[source]

Get the primary group of a given POSIX user.

Parameters:

username (str) – name of the user to get the primary group for

Returns:

name of the primary group of the given user

Return type:

str

get_users()[source]

Retrieve list of users from the POSIX nameservices system.

Returns:

list of known user names

Return type:

list