Skip to content

Commit 228f9be

Browse files
committed
gracefully degrate if CREDENTIALS_DIRECTORY is not set
1 parent 224e89b commit 228f9be

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

buildbot_nix/buildbot_nix/models.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import json
22
import os
33
import re
4-
import sys
54
from collections.abc import Callable, Mapping
65
from enum import Enum
76
from pathlib import Path
@@ -32,8 +31,7 @@ class AuthBackendConfig(str, Enum):
3231
def read_secret_file(secret_file: Path) -> str:
3332
directory = os.environ.get("CREDENTIALS_DIRECTORY")
3433
if directory is None:
35-
print("directory not set", file=sys.stderr)
36-
sys.exit(1)
34+
return secret_file.read_text().rstrip()
3735
return Path(directory).joinpath(secret_file).read_text().rstrip()
3836

3937

0 commit comments

Comments
 (0)