Skip to content

Commit 3578650

Browse files
authored
fix(vefaas): fix app release (#159)
1 parent 6573565 commit 3578650

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

veadk/integrations/ve_faas/ve_faas.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,20 @@ def _release_application(self, app_id: str):
201201
url = cloud_resource["framework"]["url"]["system_url"]
202202
return url
203203
else:
204-
logger.error(f"Release application failed: {full_response}")
205-
logs = self._get_application_logs(app_id=app_id)
206-
log_text = ""
207-
for log_line in logs:
208-
log_text += log_line.strip() + "\n"
204+
logger.error(
205+
f"Release application failed. Application ID: {app_id}, Status: {status}"
206+
)
207+
import re
208+
209+
logs = "\n".join(self._get_application_logs(app_id=app_id))
210+
log_text = re.sub(
211+
r'([{"\']?(key|secret|token|pass|auth|credential|access|api|ak|sk|doubao|volces|coze)[^"\'\s]*["\']?\s*[:=]\s*)(["\']?)([^"\'\s]+)(["\']?)|([A-Za-z0-9+/=]{20,})',
212+
lambda m: f"{m.group(1)}{m.group(3)}******{m.group(5)}"
213+
if m.group(1)
214+
else "******",
215+
logs,
216+
flags=re.IGNORECASE,
217+
)
209218
raise Exception(f"Release application failed. Logs:\n{log_text}")
210219

211220
def _get_application_status(self, app_id: str):
@@ -294,10 +303,6 @@ def _update_function_code(
294303

295304
# Get application status and extract function info
296305
status, full_response = self._get_application_status(app_id)
297-
if status == "deploy_fail":
298-
raise ValueError(
299-
f"Cannot update failed application. Current status: {status}"
300-
)
301306

302307
# Extract function name from application config
303308
cloud_resource = full_response["Result"]["CloudResource"]

0 commit comments

Comments
 (0)