Skip to content

Commit

Permalink
Fix setting workdir via OPERA_API_WORKDIR env var
Browse files Browse the repository at this point in the history
  • Loading branch information
anzoman committed Jul 14, 2022
1 parent 1eafa9b commit 1271696
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/opera/api/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os

import shutil
import connexion
from opera.api.log import get_logger
from opera.api.openapi import encoder
Expand All @@ -26,9 +26,9 @@ def main():

if WORKDIR:
try:
os.chdir(WORKDIR)
shutil.copytree(WORKDIR, os.getcwd(), dirs_exist_ok=True)
except OSError as e:
print(f"Cannot change working directory to {WORKDIR}, exception: {str(e)}")
print(f"Cannot copy files from working directory {WORKDIR}, exception: {str(e)}")

app.app.json_encoder = encoder.JSONEncoder
app.add_api("openapi.yaml", arguments={"title": "xOpera API"}, pythonic_params=True)
Expand Down

0 comments on commit 1271696

Please sign in to comment.