Skip to content

Commit a2e178b

Browse files
committed
Removed path hardcoding
1 parent db15dbc commit a2e178b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

azure_functions_worker/dispatcher.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def load_function_metadata(self, function_app_directory, caller_info):
384384
script_file_name)
385385

386386
self._function_metadata_result = (
387-
self.index_functions(function_path)) \
387+
self.index_functions(function_path, function_app_directory)) \
388388
if os.path.exists(function_path) else None
389389

390390
async def _handle__functions_metadata_request(self, request):
@@ -439,7 +439,7 @@ async def _handle__function_load_request(self, request):
439439

440440
logger.info(
441441
'Received WorkerLoadRequest, request ID %s, function_id: %s,'
442-
'function_name: %s, function_app_directory: %s',
442+
'function_name: %s, function_app_directory : %s',
443443
self.request_id, function_id, function_name,
444444
function_app_directory)
445445

@@ -750,7 +750,7 @@ async def _handle__function_environment_reload_request(self, request):
750750
request_id=self.request_id,
751751
function_environment_reload_response=failure_response)
752752

753-
def index_functions(self, function_path: str):
753+
def index_functions(self, function_path: str, function_dir: str):
754754
indexed_functions = loader.index_function_app(function_path)
755755
logger.info(
756756
"Indexed function app and found %s functions",
@@ -761,7 +761,8 @@ def index_functions(self, function_path: str):
761761
fx_metadata_results, fx_bindings_logs = (
762762
loader.process_indexed_function(
763763
self._functions,
764-
indexed_functions))
764+
indexed_functions,
765+
function_dir))
765766

766767
indexed_function_logs: List[str] = []
767768
indexed_function_bindings_logs = []

azure_functions_worker/loader.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
_DEFAULT_SCRIPT_FILENAME = '__init__.py'
2828
_DEFAULT_ENTRY_POINT = 'main'
2929
_submodule_dirs = []
30-
_FUNCTION_DIRECTORY = "/home/site/wwwroot"
3130

3231

3332
def register_function_dir(path: PathLike) -> None:
@@ -122,7 +121,7 @@ def build_variable_interval_retry(retry, max_retry_count, retry_strategy):
122121

123122

124123
def process_indexed_function(functions_registry: functions.Registry,
125-
indexed_functions):
124+
indexed_functions, function_dir):
126125
"""
127126
fx_metadata_results is a list of the RpcFunctionMetadata for
128127
all the functions in the particular app.
@@ -151,7 +150,7 @@ def process_indexed_function(functions_registry: functions.Registry,
151150
name=function_info.name,
152151
function_id=function_info.function_id,
153152
managed_dependency_enabled=False, # only enabled for PowerShell
154-
directory=_FUNCTION_DIRECTORY,
153+
directory=function_dir,
155154
script_file=indexed_function.function_script_file,
156155
entry_point=function_info.name,
157156
is_proxy=False, # not supported in V4

0 commit comments

Comments
 (0)