File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
veadk/integrations/ve_faas Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1515import json
1616import time
1717import shutil
18+ import tempfile
1819from pathlib import Path
1920from cookiecutter .main import cookiecutter
2021import veadk .integrations .ve_faas as vefaas
@@ -309,12 +310,10 @@ def _update_function_code(
309310
310311 # Get application status and extract function info
311312 status , full_response = self ._get_application_status (app_id )
312-
313313 # Extract function name from application config
314314 cloud_resource = full_response ["Result" ]["CloudResource" ]
315315 cloud_resource = json .loads (cloud_resource )
316316 function_name = cloud_resource ["framework" ]["function" ]["Name" ]
317- # existing_url = cloud_resource["framework"]["url"]["system_url"]
318317 function_id = cloud_resource ["framework" ]["function" ]["Id" ]
319318 if not function_id :
320319 raise ValueError (f"Function '{ function_name } ' not found for update" )
@@ -333,14 +332,17 @@ def _update_function_code(
333332 "veadk_version" : VERSION ,
334333 }
335334
335+ temp_base = Path (tempfile .gettempdir ())
336+
336337 cookiecutter (
337338 template = str (template_dir ),
338- output_dir = "/tmp" ,
339+ output_dir = str ( temp_base ) ,
339340 no_input = True ,
340341 extra_context = settings ,
341342 )
342343
343- tmp_path = Path ("/tmp" ) / tmp_dir_name
344+ tmp_path = temp_base / tmp_dir_name
345+
344346 try :
345347 agent_dir = tmp_path / "src" / user_proj_path .name .replace ("-" , "_" )
346348 if agent_dir .exists ():
You can’t perform that action at this time.
0 commit comments