MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / clear_nginx_config

Method clear_nginx_config

class/projectModel/pythonModel.py:2501–2516  ·  view source on GitHub ↗

@name 清除nginx配置 @author hwliang<2021-08-09> @param project: dict<项目信息> @return bool

(self, project)

Source from the content-addressed store, hash-verified

2499 return True
2500
2501 def clear_nginx_config(self, project):
2502 ''&#x27;
2503 @name 清除nginx配置
2504 @author hwliang<2021-08-09>
2505 @param project: dict<项目信息>
2506 @return bool
2507 ''&#x27;
2508 project_name = project['name']
2509 config_file = "{}/nginx/python_{}.conf".format(self._vhost_path, project_name)
2510 if os.path.exists(config_file):
2511 os.remove(config_file)
2512 rewrite_file = "{panel_path}/vhost/rewrite/python_{project_name}.conf".format(
2513 panel_path=self._panel_path, project_name=project_name)
2514 if os.path.exists(rewrite_file):
2515 os.remove(rewrite_file)
2516 return True
2517
2518 def clear_apache_config(self, project):
2519 ''&#x27;

Callers 1

clear_configMethod · 0.95

Calls 3

formatMethod · 0.45
existsMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected