This repository has been archived by the owner on Jan 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
83 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
""" | ||
Centralized place for environment variables supported internally by RKD | ||
======================================================================= | ||
Idea is to make RKD core code clean of os.getenv() calls as much as possible. | ||
The advantage is unified list of environment variables and always the same default values. | ||
""" | ||
|
||
import os | ||
from typing import List | ||
|
||
STR_BOOLEAN_TRUE = ['true', '1', 'yes'] | ||
|
||
|
||
def rkd_paths() -> List[str]: | ||
return os.getenv('RKD_PATH', '').split(':') | ||
|
||
|
||
def rkd_depth() -> int: | ||
return int(os.getenv('RKD_DEPTH', 0)) | ||
|
||
|
||
def binary_name() -> str: | ||
return os.getenv('RKD_BIN') | ||
|
||
|
||
def distribution_name() -> str: | ||
return os.getenv('RKD_DIST_NAME', 'rkd') | ||
|
||
|
||
def audit_session_log_enabled() -> bool: | ||
return os.getenv('RKD_AUDIT_SESSION_LOG', '').lower() in STR_BOOLEAN_TRUE | ||
|
||
|
||
def system_log_level() -> str: | ||
return os.getenv('RKD_SYS_LOG_LEVEL', 'info') | ||
|
||
|
||
def is_subprocess_compat_mode() -> bool: | ||
return os.getenv('RKD_COMPAT_SUBPROCESS', '').lower() in STR_BOOLEAN_TRUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters