def sync_file(self, clusters):
logger.info("<STR_LIT>")<EOL>if not self.restart_required:<EOL><INDENT>self.sync_nodes(clusters)<EOL><DEDENT>version = self.control.get_version()<EOL>with open(self.haproxy_config_path, "<STR_LIT:w>") as f:<EOL><INDENT>f.write(self.config_file.generate(clusters, version=version))<EOL><DEDENT>if self.restart_required:<EOL><INDENT>with self.restart_lock:<EOL><INDENT>self.restart()<EOL><DEDENT><DEDENT>
Generates new HAProxy config file content and writes it to the
file at `haproxy_config_path`.

If a restart is not necessary the nodes configured in HAProxy will
be synced on the fly.  If a restart *is* necessary, one will be
triggered.