コード例 #1
0
ファイル: del_intervention.py プロジェクト: jrha/aquilon
    def render(self, session, logger, hostname, cluster,
               intervention, **arguments):

        validate_basic("intervention", intervention)
        holder = get_resource_holder(session, hostname, cluster)
        dbapp = Intervention.get_unique(session, name=intervention,
                                        holder=holder, compel=True)
        del_resource(session, logger, dbapp)
        return
コード例 #2
0
ファイル: del_intervention.py プロジェクト: ned21/aquilon
    def render(self, session, logger, hostname, cluster, intervention,
               **arguments):

        validate_basic("intervention", intervention)
        holder = get_resource_holder(session, hostname, cluster)
        dbapp = Intervention.get_unique(session,
                                        name=intervention,
                                        holder=holder,
                                        compel=True)
        del_resource(session, logger, dbapp)
        return
コード例 #3
0
ファイル: add_intervention.py プロジェクト: jrha/aquilon
            raise ArgumentError("the expiry value '%s' could not be "
                                "interpreted: %s" % (expiry, e))

        if start_time is None:
            start_when = datetime.utcnow().replace(microsecond=0)
        else:
            try:
                start_when = parse(start_time)
            except ValueError, e:
                raise ArgumentError("the start time '%s' could not be "
                                    "interpreted: %s" % (start_time, e))

        if start_when > expire_when:
            raise ArgumentError("the start time is later than the expiry time")

        holder = get_resource_holder(session, hostname, cluster, compel=False)

        Intervention.get_unique(session, name=intervention, holder=holder,
                                preclude=True)

        dbiv = Intervention(name=intervention,
                            expiry_date=expire_when,
                            start_date=start_when,
                            users=allowusers,
                            groups=allowgroups,
                            disabled=disabled_actions,
                            comments=comments,
                            justification=justification)

        return add_resource(session, logger, holder, dbiv)
コード例 #4
0
ファイル: add_intervention.py プロジェクト: ned21/aquilon
        if start_time is None:
            start_when = datetime.utcnow().replace(microsecond=0)
        else:
            try:
                start_when = parse(start_time)
            except ValueError, e:
                raise ArgumentError("the start time '%s' could not be "
                                    "interpreted: %s" % (start_time, e))

        if start_when > expire_when:
            raise ArgumentError("the start time is later than the expiry time")

        holder = get_resource_holder(session, hostname, cluster, compel=False)

        Intervention.get_unique(session,
                                name=intervention,
                                holder=holder,
                                preclude=True)

        dbiv = Intervention(name=intervention,
                            expiry_date=expire_when,
                            start_date=start_when,
                            users=allowusers,
                            groups=allowgroups,
                            disabled=disabled_actions,
                            comments=comments,
                            justification=justification)

        return add_resource(session, logger, holder, dbiv)