mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-14 02:58:10 +00:00
Keep both C# and python http functions active when deploying (#2212)
* Kepp both C# and python http functions active when deploying * update logic * update log message * use the function name instead of a list
This commit is contained in:
@ -1121,8 +1121,16 @@ class Client:
|
|||||||
max_tries = 5
|
max_tries = 5
|
||||||
for i in range(max_tries):
|
for i in range(max_tries):
|
||||||
try:
|
try:
|
||||||
# disable python function
|
# keep the python versions of http function to allow the service to be backward compatible
|
||||||
logger.info(f"disabling PYTHON function: {function_name}")
|
# with older version of the CLI and the agents
|
||||||
|
if function_name.startswith(
|
||||||
|
"queue_"
|
||||||
|
) or function_name.startswith("timer_"):
|
||||||
|
logger.info(f"disabling PYTHON function: {function_name}")
|
||||||
|
disable_python = "1"
|
||||||
|
else:
|
||||||
|
logger.info(f"enabling PYTHON function: {function_name}")
|
||||||
|
disable_python = "0"
|
||||||
subprocess.check_output(
|
subprocess.check_output(
|
||||||
[
|
[
|
||||||
func,
|
func,
|
||||||
@ -1135,7 +1143,7 @@ class Client:
|
|||||||
"--resource-group",
|
"--resource-group",
|
||||||
self.application_name,
|
self.application_name,
|
||||||
"--settings",
|
"--settings",
|
||||||
f"AzureWebJobs.{function_name}.Disabled=1",
|
f"AzureWebJobs.{function_name}.Disabled={disable_python}",
|
||||||
],
|
],
|
||||||
env=dict(os.environ, CLI_DEBUG="1"),
|
env=dict(os.environ, CLI_DEBUG="1"),
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user