Skip to content

Commit

Permalink
make deployments not compulsory
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytropolityka committed May 19, 2024
1 parent 9348bf3 commit f014359
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions assessment_module_manager/assessment_module_manager/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from assessment_module_manager.deployment import list_deployments
from assessment_module_manager.module.list_modules import list_modules
from assessment_module_manager.logger import logger

PRODUCTION = os.environ.get("PRODUCTION", "0") == "1"

Expand All @@ -18,8 +19,9 @@
for deployment in list_deployments():
secret = os.environ.get(f"ARTEMIS_{deployment.name.upper()}_SECRET")
if secret is None and PRODUCTION:
raise ValueError(f"Missing secret for Artemis deployment {deployment.name}. "
f"Set the {deployment.name.upper()}_SECRET environment variable to secure the communication "
f"between the LMS and the assessment module manager.")
logger.warning("Missing secret for Artemis deployment %s. "
"Set the %s_SECRET environment variable to secure the communication "
"between the LMS and the assessment module manager.",
deployment.name, deployment.name.upper())
secret = "abcdef12345" # noqa: This secret is only used for development setups for simplicity
DEPLOYMENT_SECRETS[deployment.url] = secret

0 comments on commit f014359

Please sign in to comment.