def get_current_nodes(self, clusters):
current_nodes = self.control.get_active_nodes()<EOL>enabled_nodes = collections.defaultdict(list)<EOL>for cluster in clusters:<EOL><INDENT>if not cluster.nodes:<EOL><INDENT>continue<EOL><DEDENT>if cluster.name not in current_nodes:<EOL><INDENT>logger.debug(<EOL>"<STR_LIT>",<EOL>cluster.name<EOL>)<EOL>self.restart_required = True<EOL><DEDENT>for node in cluster.nodes:<EOL><INDENT>if node.name not in [<EOL>current_node["<STR_LIT>"]<EOL>for current_node in current_nodes.get(cluster.name, [])<EOL>]:<EOL><INDENT>logger.debug(<EOL>"<STR_LIT>",<EOL>cluster.name<EOL>)<EOL>self.restart_required = True<EOL><DEDENT>enabled_nodes[cluster.name].append(node.name)<EOL><DEDENT><DEDENT>return current_nodes, enabled_nodes<EOL>
Returns two dictionaries, the current nodes and the enabled nodes.

The current_nodes dictionary is keyed off of the cluster name and
values are a list of nodes known to HAProxy.

The enabled_nodes dictionary is also keyed off of the cluster name
and values are list of *enabled* nodes, i.e. the same values as
current_nodes but limited to servers currently taking traffic.