diff --git a/apps/applications/models/application.py b/apps/applications/models/application.py index 15e7dae14..af1e27c2d 100644 --- a/apps/applications/models/application.py +++ b/apps/applications/models/application.py @@ -288,15 +288,14 @@ class Application(CommonModelMixin, OrgModelMixin, ApplicationTreeNodeMixin): raise ValueError("Remote App not has asset attr") def get_target_ip(self): + target_ip = '' if self.category_remote_app: asset = self.get_remote_app_asset() - target_ip = asset.ip + target_ip = asset.ip if asset else target_ip elif self.category_cloud: target_ip = self.attrs.get('cluster') elif self.category_db: target_ip = self.attrs.get('host') - else: - target_ip = '' return target_ip