Esempio n. 1
0
    def next_ok(self, action, when=None):
        """
        Return the next time at or after the specified time (default now)
        that it will be ok to perform the specified action.

        :param action:
            The action to check.

        :param when:
            A datetime object.
        """
        assert action == 'load-acl'
        return self.bounce.next_ok(changemgmt.BounceStatus('green'), when)
Esempio n. 2
0
    def allowable(self, action, when=None):
        """
        Return whether it's okay to perform the specified ``action``.

        False means a bounce window conflict. For now ``'load-acl'`` is the
        only valid action and moratorium status is not checked.

        :param action:
            The action to check.

        :param when:
            A datetime object.
        """
        assert action == 'load-acl'
        return self.bounce.status(when) == changemgmt.BounceStatus('green')