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

Method del_vhost

class/projectModel/javaModel.py:1455–1479  ·  view source on GitHub ↗

@name 删除虚拟主机 @author lkq @param domain: string @return bool

(self, domain, context_path: str = "")

Source from the content-addressed store, hash-verified

1453 return True
1454
1455 def del_vhost(self, domain, context_path: str = ""):
1456 '''
1457 @name 删除虚拟主机
1458 @author lkq
1459 @param domain: string
1460 @return bool
1461 '''
1462 if domain == 'localhost': return False
1463 host = self.get_vhost(domain)
1464 if not host: return False
1465 target_context, other_context_count = None, 0
1466 for i in host:
1467 if i.tag == "Context":
1468 if i.attrib["path"] == context_path:
1469 target_context = i
1470 else:
1471 other_context_count += 1
1472 if target_context is None and not other_context_count:
1473 return False
1474 if target_context is not None:
1475 host.remove(target_context)
1476 if not other_context_count:
1477 self.__ENGINE.remove(host)
1478 self.save_tomcat()
1479 return True
1480
1481 def tomcat_vhost_delete(self, version, domains, get):
1482 '''

Callers 1

tomcat_vhost_deleteMethod · 0.95

Calls 3

get_vhostMethod · 0.95
save_tomcatMethod · 0.95
removeMethod · 0.45

Tested by

no test coverage detected