def setEntitlementClassesRoles(self, authToken, classInfo):
        """
        @param classInfo: Dictionary indexed by entitlement class, each
        entry being a list of exactly the roles that entitlement group
        should have access to.
        @type classInfo: dict
        """
        if not self.authCheck(authToken, admin = True):
            raise errors.InsufficientPermission
        cu = self.db.cursor()

        # Get entitlement group ids
        placeholders = ','.join(['?' for x in classInfo])
        names = classInfo.keys()
        cu.execute("""SELECT entGroup, entGroupId FROM EntitlementGroups
                      WHERE entGroup IN (%s)""" %
            (placeholders,), names)
        entClassMap = dict(cu)
        if len(entClassMap) != len(classInfo):
            raise errors.RoleNotFound

        # Get user group ids
        rolesNeeded = list(set(itertools.chain(*classInfo.itervalues())))
        if rolesNeeded:
            placeholders = ','.join(['?' for x in rolesNeeded])
            cu.execute("""SELECT userGroup, userGroupId FROM UserGroups
                              WHERE userGroup IN (%s)""" %
                    (placeholders,), rolesNeeded)
            roleMap = dict(cu)
        else:
            roleMap = {}
        if len(roleMap) != len(rolesNeeded):
            raise errors.RoleNotFound

        # Clear any existing entries for the specified entitlement classes
        entClassIds = ','.join([x % '%d' for x in entClassMap.itervalues()])
        cu.execute("""DELETE FROM EntitlementAccessMap
                      WHERE entGroupId IN (%s)""" %
                (entClassIds,))

        # Add new entries.
        for entClass, roles in classInfo.iteritems():
            for role in roles:
                cu.execute("""INSERT INTO EntitlementAccessMap
                              (entGroupId, userGroupId) VALUES (?, ?)""",
                           entClassMap[entClass], roleMap[role])

        self.db.commit()
dataset/ETHPy150Open sassoftware/conary/conary/repository/netrepos/netauth.py/NetworkAuthorization.setEntitlementClassesRoles/swapped operands of `%`