def getGroups(self, username, groupsManager: GroupsManager): # these groups are a bit special. They are in fact ip-ranges, and we must check that the ip is in betwen # The ranges are stored in group names for g in groupsManager.getGroupsNames(): try: if net.ipInNetwork(username, g): groupsManager.validate(g) except Exception as e: logger.error('Invalid network for IP auth: %s', e)