def sync_nodes(self, clusters):
logger.info("<STR_LIT>")<EOL>current_nodes, enabled_nodes = self.get_current_nodes(clusters)<EOL>for cluster_name, nodes in six.iteritems(current_nodes):<EOL><INDENT>for node in nodes:<EOL><INDENT>if node["<STR_LIT>"] in enabled_nodes[cluster_name]:<EOL><INDENT>command = self.control.enable_node<EOL><DEDENT>else:<EOL><INDENT>command = self.control.disable_node<EOL><DEDENT>try:<EOL><INDENT>response = command(cluster_name, node["<STR_LIT>"])<EOL><DEDENT>except Exception:<EOL><INDENT>logger.exception("<STR_LIT>")<EOL>self.restart_required = True<EOL><DEDENT>else:<EOL><INDENT>if response:<EOL><INDENT>logger.error(<EOL>"<STR_LIT>",<EOL>cluster_name, node["<STR_LIT>"], response<EOL>)<EOL>self.restart_required = True<EOL>return<EOL><DEDENT><DEDENT><DEDENT><DEDENT>logger.info("<STR_LIT>")<EOL>
Syncs the enabled/disabled status of nodes existing in HAProxy based
on the given clusters.

This is used to inform HAProxy of up/down nodes without necessarily
doing a restart of the process.