feat: 修改 Endpoint 获取 Manugs DB listen port 的逻辑

This commit is contained in:
Jiangjie.Bai
2022-09-22 15:52:47 +08:00
parent b8ec60dea1
commit 57e12256e7
8 changed files with 48 additions and 67 deletions

View File

@@ -62,12 +62,15 @@ class ConnectionTokenMixin:
def get_smart_endpoint(self, protocol, asset=None, application=None):
if asset:
target_instance = asset
target_ip = asset.get_target_ip()
elif application:
target_instance = application
target_ip = application.get_target_ip()
else:
target_instance = None
target_ip = ''
endpoint = EndpointRule.match_endpoint(target_ip, protocol, self.request)
endpoint = EndpointRule.match_endpoint(target_instance, target_ip, protocol, self.request)
return endpoint
@staticmethod