(groupname, ldap_server=None)
return membership, groups
Get membership of a group.

  Args:
    groupname: name of the group to query
    ldap_server: use this LDAP server to try to convert nested group UUIDs to
                 human-readable form.

  Returns:
    (membership, groups)
    membership: group members array, 'UNKNOWN' on error
    groups: array of human readable nested group names, 'UNKNOWN' on error
Get membership of a group.
Get membership of a group .
def GetGroupMembership(groupname, ldap_server=None):
  """Get membership of a group.

  Args:
    groupname: name of the group to query
    ldap_server: use this LDAP server to try to convert nested group UUIDs to
                 human-readable form.

  Returns:
    (membership, groups)
    membership: group members array, 'UNKNOWN' on error
    groups: array of human readable nested group names, 'UNKNOWN' on error
  """
  try:
    membership = DSQuery('group', groupname, attribute='GroupMembership')
  except DSException:
    membership = 'UNKNOWN'

  try:
    nested_groups = DSQuery('group', groupname, attribute='NestedGroups')
    if nested_groups:
      groups = []
      for groupuid in nested_groups:
        groupname = _GetNameFromGroupUID(groupuid,
                                         ldap_server=ldap_server)
        if not groupname:
          groupname = groupuid

        groups.append(groupname)
    else:
      groups = None
  except DSException:
    groups = 'UNKNOWN'

  return membership, groups
def GetGroupMembership ( groupname , ldap_server = None ) : try : membership = DSQuery ( 'group' , groupname , attribute = 'GroupMembership' ) except DSException : membership = 'UNKNOWN' try : nested_groups = DSQuery ( 'group' , groupname , attribute = 'NestedGroups' ) if nested_groups : groups = [ ] for groupuid in nested_groups : groupname = _GetNameFromGroupUID ( groupuid , ldap_server = ldap_server ) if not groupname : groupname = groupuid groups . append ( groupname ) else : groups = None except DSException : groups = 'UNKNOWN' return membership , groups