def restart(self):
version = self.get_version()<EOL>command = [<EOL>"<STR_LIT>",<EOL>"<STR_LIT>", self.config_file_path, "<STR_LIT>", self.pid_file_path<EOL>]<EOL>if version and version >= (<NUM_LIT:1>, <NUM_LIT:5>, <NUM_LIT:0>):<EOL><INDENT>command.extend(["<STR_LIT>", self.peer.name])<EOL><DEDENT>if os.path.exists(self.pid_file_path):<EOL><INDENT>with open(self.pid_file_path) as fd:<EOL><INDENT>command.extend(["<STR_LIT>", fd.read().replace("<STR_LIT:\n>", "<STR_LIT>")])<EOL><DEDENT><DEDENT>try:<EOL><INDENT>output = subprocess.check_output(command)<EOL><DEDENT>except subprocess.CalledProcessError as e:<EOL><INDENT>logger.error("<STR_LIT>", str(e))<EOL>return<EOL><DEDENT>if output:<EOL><INDENT>logging.error("<STR_LIT>", output)<EOL><DEDENT>logger.info("<STR_LIT>")<EOL>
Performs a soft reload of the HAProxy process.