コード例 #1
0
    def _reprogram_chains(self):
        """
        Recalculates the chains and writes them to iptables.

        Synchronous, doesn't return until the chain is in place.
        """
        _log.info("%s Updating dispatch chain, num entries: %s", self,
                  len(self.ifaces))
        update = self._calculate_update(self.ifaces)
        to_delete, deps, updates, new_leaf_chains = update
        futures = [
            self.iptables_updater.rewrite_chains(updates, deps, async=True),
            self.iptables_updater.delete_chains(to_delete, async=True),
        ]
        wait_and_check(futures)

        # Track our chains so we can clean them up.
        self.programmed_leaf_chains = new_leaf_chains
コード例 #2
0
ファイル: dispatch.py プロジェクト: GrimDerp/calico
    def _reprogram_chains(self):
        """
        Recalculates the chains and writes them to iptables.

        Synchronous, doesn't return until the chain is in place.
        """
        _log.info("%s Updating dispatch chain, num entries: %s", self,
                  len(self.ifaces))
        update = self._calculate_update(self.ifaces)
        to_delete, deps, updates, new_leaf_chains = update
        futures = [
            self.iptables_updater.rewrite_chains(updates, deps,
                                                 async=True),
            self.iptables_updater.delete_chains(to_delete,
                                                async=True),
        ]
        wait_and_check(futures)

        # Track our chains so we can clean them up.
        self.programmed_leaf_chains = new_leaf_chains
コード例 #3
0
 def test_wait_and_check_no_input(self):
     actor.wait_and_check([])
コード例 #4
0
ファイル: test_actor.py プロジェクト: GrimDerp/calico
 def test_wait_and_check_no_input(self):
     actor.wait_and_check([])