This is an automatically generated e-mail. To reply, visit: http://reviewboard-fedoraserver.rhcloud.com/r/122/

src/rolekit/server/dbusrole.py (Diff revision 1)
def deploy(self, name, values,
299
        # limit role instances to 1 for now
299
        # limit role instances to max instances either per role or globally
300
        if len(self._instances) >= MAX_INSTANCES:
300
        max_instances = MAX_INSTANCES
301
            raise RolekitError(TOO_MANY_INSTANCES, "> 1")
301
        if hasattr(self._role, "_MAX_INSTANCES"):
302
            max_instances = self._role._MAX_INSTANCES
303
        if len(self._instances) >= max_instances:
304
            raise RolekitError(TOO_MANY_INSTANCES, "> %d" % max_instances)

I think it makes more sense to set the _MAX_INSTANCES default value in RoleBase and then just allow the role implementations to override it if they want to. It seems less complex.


- Stephen Gallagher


On November 7th, 2014, 7:34 p.m. UTC, Thomas Woerner wrote:

Review request for RoleKit Mailing List, Miloslav Trmac, Stephen Gallagher, and Thomas Woerner.
By Thomas Woerner.

Updated Nov. 7, 2014, 7:34 p.m.

Repository: rolekit

Description

If _MAX_INSTANCES is defined in the role, then it will be used as the maximum
count of instances for this role. If is is not defined, the global
MAX_INSTANCES definition will be used.

To set a different maximum instance count, add _MAX_INSTANCES=X to the Role
definition in role.py next to _DEFAULTS and _READONLY_SETTINGS.

Diffs

  • src/rolekit/server/dbusrole.py (5f978215a94e304ae76b410a59ec7f598219cedc)

View Diff