mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 20:38:06 +00:00
handle nested exceptions during cleanup on function deploy failures (#172)
This commit is contained in:
@ -586,11 +586,9 @@ class Client:
|
|||||||
|
|
||||||
def deploy_app(self):
|
def deploy_app(self):
|
||||||
logger.info("deploying function app %s", self.app_zip)
|
logger.info("deploying function app %s", self.app_zip)
|
||||||
current_dir = os.getcwd()
|
|
||||||
with tempfile.TemporaryDirectory() as tmpdirname:
|
with tempfile.TemporaryDirectory() as tmpdirname:
|
||||||
with zipfile.ZipFile(self.app_zip, "r") as zip_ref:
|
with zipfile.ZipFile(self.app_zip, "r") as zip_ref:
|
||||||
zip_ref.extractall(tmpdirname)
|
zip_ref.extractall(tmpdirname)
|
||||||
os.chdir(tmpdirname)
|
|
||||||
subprocess.check_output(
|
subprocess.check_output(
|
||||||
[
|
[
|
||||||
shutil.which("func"),
|
shutil.which("func"),
|
||||||
@ -602,10 +600,9 @@ class Client:
|
|||||||
"--no-build",
|
"--no-build",
|
||||||
],
|
],
|
||||||
env=dict(os.environ, CLI_DEBUG="1"),
|
env=dict(os.environ, CLI_DEBUG="1"),
|
||||||
|
cwd=tmpdirname,
|
||||||
)
|
)
|
||||||
|
|
||||||
os.chdir(current_dir)
|
|
||||||
|
|
||||||
def update_registration(self):
|
def update_registration(self):
|
||||||
if not self.create_registration:
|
if not self.create_registration:
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user