4be50b0bab48f3aafa523cc8e807392dbd6cba81,poseidon/poseidonMonitor/NorthBoundControllerAbstraction/proxy/faucet/parser.py,Parser,config,#Parser#Any#Any#Any#Any#,39

Before Change



        // TODO set the timeout and arp_neighbor_timeout for each dp to the reinvestigation_frequency or 900 seconds
        self.logger.info("reinvestigation_freq: " + str(self.reinvestigation_frequency))
        self.logger.info("max_concurrent: " + str(self.max_concurrent_reinvestigations))

        if action == "mirror" or action == "unmirror":
            ok = True

After Change


                if action == "mirror":
                    // TODO make this smarter about more complex configurations (backup original values, etc)
                    obj_doc["dps"][switch_found]["timeout"] = self.reinvestigation_frequency
                    obj_doc["dps"][switch_found]["arp_neighbor_timeout"] = self.reinvestigation_frequency
                    if not port in obj_doc["dps"][switch_found]["interfaces"][self.mirror_ports[switch_found]]["mirror"] and port is not None:
                        obj_doc["dps"][switch_found]["interfaces"][self.mirror_ports[switch_found]]["mirror"].append(
                            port)
                elif action == "unmirror":
                    try:
                        // TODO check for still running captures on this port
                        obj_doc["dps"][switch_found]["interfaces"][self.mirror_ports[switch_found]]["mirror"].remove(
                            port)
                    except ValueError:
                        self.logger.warning("This port: {0} was not already "
                                            "mirroring on this switch: {1}".format(str(port), str(switch_found)))
            else:
                self.logger.error("Unable to mirror due to warnings")
                return False
        elif action == "shutdown":
            // TODO
            pass
        else:
            self.logger.warning("Unknown action: {0}".format(action))
        try:
            if len(obj_doc["dps"][switch_found]["interfaces"][self.mirror_ports[switch_found]]["mirror"]) == 0:
                obj_doc["dps"][switch_found]["interfaces"][self.mirror_ports[switch_found]].remove(
                    "mirror")
                // TODO make this smarter about more complex configurations (backup original values, etc)
                del obj_doc["dps"][switch_found]["timeout"]
                del obj_doc["dps"][switch_found]["arp_neighbor_timeout"]
            else:
                ports = []
                for p in obj_doc["dps"][switch_found]["interfaces"][self.mirror_ports[switch_found]]["mirror"]:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: CyberReboot/poseidon
Commit Name: 4be50b0bab48f3aafa523cc8e807392dbd6cba81
Time: 2018-08-24
Author: clewis@iqt.org
File Name: poseidon/poseidonMonitor/NorthBoundControllerAbstraction/proxy/faucet/parser.py
Class Name: Parser
Method Name: config


Project Name: CyberReboot/poseidon
Commit Name: 4be50b0bab48f3aafa523cc8e807392dbd6cba81
Time: 2018-08-24
Author: clewis@iqt.org
File Name: poseidon/poseidonMonitor/NorthBoundControllerAbstraction/proxy/faucet/parser.py
Class Name: Parser
Method Name: config


Project Name: comic/grand-challenge.org
Commit Name: 869d420ded61dce0ef4fd036cebf8f567915f69a
Time: 2019-04-08
Author: harm.van.zeeland@gmail.com
File Name: app/tests/retina_api_tests/test_viewsets.py
Class Name: TestSinglePolygonAnnotationViewSet
Method Name: test_partial_update_view


Project Name: dickreuter/Poker
Commit Name: 326330df0cadc4adcecfa9b8c3a83f465f977fb4
Time: 2016-09-09
Author: dickreuter@yahoo.com
File Name: mongo_manager.py
Class Name: Logging
Method Name: write_log_file