On Tue, Dec 08, 2009 at 02:58:25PM +0000, Guido Trotter wrote:
> Rather than doing one query per instance, make only one query in total.
>
> Signed-off-by: Guido Trotter <[email protected]>
LGTM, but:
> ---
> + instances = up.orig_request.query[gnt_constants.CONFD_REQQ_IPLIST]
> + link = up.orig_request.query[gnt_constants.CONFD_REQQ_LINK]
> + replies = up.server_reply.answer
> +
> + for instance, reply in zip(instances, replies):
> + status, node = reply
> + if status != gnt_constants.CONFD_REPL_STATUS_OK:
> + logging.debug("Error %s retrieving node for instance %s: %s"
> + % (status, instance, node))
^ wrong indentation, IMHO
> + continue
> + if not node:
> + logging.debug("Empty answer retrieving node for instance %s"
> + % instance)
^ same here
> + continue
> + tunnel = self.nld_config.tables_tunnels[link]
> + networktables.UpdateNetworkEntry(instance, node,
> + networktables.NEIGHBOUR_CONTEXT,
> + tunnel)
>
> def __call__(self, up):
> """Filtering callback
> --
> 1.6.5
>