Fix code quality warnings
This commit is contained in:
parent
726981a881
commit
44a4a917a1
|
@ -118,12 +118,12 @@ class SecretLoader:
|
||||||
self.env_key_prefix = self._load_or_none(ENV_KEY_PREFIX)
|
self.env_key_prefix = self._load_or_none(ENV_KEY_PREFIX)
|
||||||
if self.env_key_prefix is not None:
|
if self.env_key_prefix is not None:
|
||||||
logger.info('Environment enabled with prefix: %s', self.env_key_prefix)
|
logger.info('Environment enabled with prefix: %s', self.env_key_prefix)
|
||||||
assert (
|
if self.env_key_prefix != self.env_key_prefix.upper():
|
||||||
self.env_key_prefix == self.env_key_prefix.upper()
|
msg = 'Prefix must be uppercase'
|
||||||
), 'Prefix must be uppercase'
|
raise ValueError(msg)
|
||||||
assert not self.env_key_prefix.endswith(
|
if self.env_key_prefix.endswith('_'):
|
||||||
'_',
|
msg = 'Prefix must not end with _ (this will be added automatically)'
|
||||||
), 'Prefix must not end with _ (this will be added automatically)'
|
raise ValueError(msg)
|
||||||
|
|
||||||
# Setup secrets path
|
# Setup secrets path
|
||||||
self.secret_folder = Path(
|
self.secret_folder = Path(
|
||||||
|
@ -210,8 +210,12 @@ class SecretLoader:
|
||||||
if self.pass_folder is None:
|
if self.pass_folder is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
cmd = ['pass', 'show', f'{self.pass_folder}/{secret_name.lower()}']
|
process = subprocess.run( # noqa: S603
|
||||||
process = subprocess.run(cmd, capture_output=True, check=False)
|
['/usr/bin/pass', 'show', f'{self.pass_folder}/{secret_name.lower()}'],
|
||||||
|
capture_output=True,
|
||||||
|
check=False,
|
||||||
|
shell=False,
|
||||||
|
)
|
||||||
if process.returncode:
|
if process.returncode:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user