Update the up() function to exit if the policies file path is not valid.

This commit is contained in:
Hemang
2025-02-28 11:04:49 +01:00
committed by Hemang Sarkar
parent 5ecab37feb
commit d9d4ba0344
2 changed files with 4 additions and 3 deletions
-2
View File
@@ -10,7 +10,6 @@ class ProxyConfig:
"""Common configurations for the Proxy Server."""
def __init__(self):
print("hello in init of ProxyConfig")
self.policies = self._load_policies()
def _load_policies(self) -> str:
@@ -18,7 +17,6 @@ class ProxyConfig:
Loads and validates policies from the file specified in POLICIES_FILE_PATH.
Returns the policy file content as a string if valid; otherwise, raises an error.
"""
print("hello in load_policies")
policies_file = os.getenv("POLICIES_FILE_PATH", "")
if not policies_file:
+4 -1
View File
@@ -20,8 +20,11 @@ up() {
shift
done
if [[ -n "$POLICIES_FILE_PATH" ]]; then
if [[ -n "$POLICIES_FILE_PATH" && -f "$POLICIES_FILE_PATH" ]]; then
POLICIES_FILE_PATH=$(realpath "$POLICIES_FILE_PATH")
else
echo "Error: Specified policies file does not exist: $POLICIES_FILE_PATH"
exit 1
fi
# Start Docker Compose with the correct environment variable