def run(self):
        """ Connects to both ZKs, inserts an ephemeral node, and starts a watch for changes. """
        try:
            self._join_party()
            self.conn.zk.add_listener(self._state_listener)

            @ThrottledChildrenWatch(self.conn.zk, self.zk_ip_map_path, delay_min=constants.TIME_DELAY_MIN, delay_max=constants.TIME_DELAY_MAX)
            def update_iptables(hosts):
                self.max_change_threshold = self._load_param(self.zk_max_change_threshold_path, constants.DEFAULT_MAX_CHANGE_THRESHOLD)
                if getattr(self, "hosts", None):
                    hosts_to_remove = len(self.hosts) - len(hosts)
                    if hosts_to_remove > self.max_change_threshold:
                        logger.warn("Trying to remove %d hosts...untriggering (max is %s)" % (hosts_to_remove, self.max_change_threshold))
                        return
                    else:
                        remove = set(self.hosts) - set(hosts)
                        add = set(hosts) - set(self.hosts)
                        if add:
                            logger.debug(add % "Adding: %s")
                        if remove:
                            logger.debug("Removing: %s" % remove)
                self.hosts = hosts
                bundles = self._ips_from_entries(self.hosts)
                builder = IPtables(config=self.config, is_vpc=self.conn._is_vpc, dry_run=self.dry_run)
                builder.build(bundles)

            while True:
                self.conn.zk.handler.sleep_func(constants.DEFAULT_SLEEP)

        except ZookeeperError as e:
            logger.error("ZookeeperError: %s" % e)
            self.run()
dataset/ETHPy150Open facebookarchive/neti/neti/registry.py/Registry.run/swapped operands of `%`