check for required variables before doing anything else in _get_contents_from_keepass()
This commit is contained in:
parent
a500310042
commit
91ff5c57eb
1 changed files with 3 additions and 3 deletions
|
@ -29,6 +29,9 @@ except (FileNotFoundError, IndexError):
|
||||||
|
|
||||||
|
|
||||||
def _get_contents_from_keepass(path):
|
def _get_contents_from_keepass(path):
|
||||||
|
if not KEEPASS_FILE or not KEEPASS_PASS:
|
||||||
|
raise FaultUnavailable('BW_KEEPASS_FILE and/or BW_KEEPASS_PASSWORD missing')
|
||||||
|
|
||||||
if isinstance(path, list):
|
if isinstance(path, list):
|
||||||
list_path = path
|
list_path = path
|
||||||
string_path = '|'.join(path)
|
string_path = '|'.join(path)
|
||||||
|
@ -47,9 +50,6 @@ def _get_contents_from_keepass(path):
|
||||||
path=list_path,
|
path=list_path,
|
||||||
file=KEEPASS_FILE,
|
file=KEEPASS_FILE,
|
||||||
)):
|
)):
|
||||||
if not KEEPASS_FILE or not KEEPASS_PASS:
|
|
||||||
raise FaultUnavailable('BW_KEEPASS_FILE and/or BW_KEEPASS_PASSWORD missing')
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
keepass = PyKeePass(expanduser(KEEPASS_FILE), KEEPASS_PASS)
|
keepass = PyKeePass(expanduser(KEEPASS_FILE), KEEPASS_PASS)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue