示例#1
0
    def update_destination_no_check(self,
                                    flow,
                                    node,
                                    destination,
                                    rule=None):  # pragma: no cover
        """ Update the destination without doing a cycle check """
        # look up our destination, we need this in order to set the correct destination_type
        destination_type = FlowStep.TYPE_ACTION_SET
        action_destination = Flow.get_node(flow, destination, destination_type)
        if not action_destination:
            destination_type = FlowStep.TYPE_RULE_SET
            ruleset_destination = Flow.get_node(flow, destination,
                                                destination_type)
            self.assertTrue(
                ruleset_destination,
                "Unable to find new destination with uuid: %s" % destination)

        actionset = ActionSet.get(flow, node)
        if actionset:
            actionset.destination = destination
            actionset.destination_type = destination_type
            actionset.save()

        ruleset = RuleSet.get(flow, node)
        if ruleset:
            rules = ruleset.get_rules()
            for r in rules:
                if r.uuid == rule:
                    r.destination = destination
                    r.destination_type = destination_type
            ruleset.set_rules(rules)
            ruleset.save()
        else:
            self.fail("Couldn't find node with uuid: %s" % node)
示例#2
0
    def update_destination_no_check(self, flow, node, destination, rule=None):  # pragma: no cover
        """ Update the destination without doing a cycle check """
        # look up our destination, we need this in order to set the correct destination_type
        destination_type = ACTION_SET
        action_destination = Flow.get_node(flow, destination, destination_type)
        if not action_destination:
            destination_type = RULE_SET
            ruleset_destination = Flow.get_node(flow, destination, destination_type)
            self.assertTrue(ruleset_destination, "Unable to find new destination with uuid: %s" % destination)

        actionset = ActionSet.get(flow, node)
        if actionset:
            actionset.destination = destination
            actionset.destination_type = destination_type
            actionset.save()

        ruleset = RuleSet.get(flow, node)
        if ruleset:
            rules = ruleset.get_rules()
            for r in rules:
                if r.uuid == rule:
                    r.destination = destination
                    r.destination_type = destination_type
            ruleset.set_rules(rules)
            ruleset.save()
        else:
            self.fail("Couldn't find node with uuid: %s" % node)
示例#3
0
    def update_destination_no_check(self, flow, node, destination, rule=None):
        """ Update the destination without doing a cycle check """
        actionset = ActionSet.get(flow, node)
        if actionset:
            actionset.destination = destination
            actionset.save()

        ruleset = RuleSet.get(flow, node)
        rules = ruleset.get_rules()
        for r in rules:
            if r.uuid == rule:
                r.destination = destination
        ruleset.set_rules(rules)
        ruleset.save()
示例#4
0
    def update_destination_no_check(self, flow, node, destination, rule=None):
        """ Update the destination without doing a cycle check """
        actionset = ActionSet.get(flow, node)
        if actionset:
            actionset.destination = destination
            actionset.save()

        ruleset = RuleSet.get(flow, node)
        rules = ruleset.get_rules()
        for r in rules:
            if r.uuid == rule:
                r.destination = destination
        ruleset.set_rules(rules)
        ruleset.save()