Also handle permission error
This commit is contained in:
parent
3d50688b61
commit
2aa982d407
|
@ -184,7 +184,7 @@ class SecretLoader:
|
||||||
try:
|
try:
|
||||||
with open(filepath) as f:
|
with open(filepath) as f:
|
||||||
return f.read().strip()
|
return f.read().strip()
|
||||||
except FileNotFoundError:
|
except (FileNotFoundError, PermissionError):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _load_or_none_env(self, secret_name) -> str | None:
|
def _load_or_none_env(self, secret_name) -> str | None:
|
||||||
|
@ -210,7 +210,7 @@ class SecretLoader:
|
||||||
check=False,
|
check=False,
|
||||||
shell=False,
|
shell=False,
|
||||||
)
|
)
|
||||||
except FileNotFoundError:
|
except (FileNotFoundError, PermissionError):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return self._convert_pass_process_result_to_password(
|
return self._convert_pass_process_result_to_password(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user