mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Review and confirm issue #63
This commit is contained in:
parent
e5731749bf
commit
28601181cf
1 changed files with 7 additions and 5 deletions
|
|
@ -147,7 +147,7 @@ def load_keystore_from_keyfiles(directory_name, keyids, passwords):
|
|||
<Arguments>
|
||||
directory_name:
|
||||
The name of the directory containing the key files ('<keyid>.key'),
|
||||
conformant to tuf.formats.RELPATH_SCHEMA.
|
||||
conformant to 'tuf.formats.RELPATH_SCHEMA'.
|
||||
|
||||
keyids:
|
||||
A list containing the keyids of the signing keys to load.
|
||||
|
|
@ -188,10 +188,8 @@ def load_keystore_from_keyfiles(directory_name, keyids, passwords):
|
|||
|
||||
logger.info('Loading private key(s) from '+repr(directory_name))
|
||||
|
||||
# Make sure the directory exists.
|
||||
if not os.path.exists(directory_name):
|
||||
logger.warn('...no such directory. Keystore cannot be loaded.')
|
||||
else:
|
||||
# Load the private key(s) if 'directory_name' exists, otherwise log a warning.
|
||||
if os.path.exists(directory_name):
|
||||
# Decrypt the keys we can from those stored in 'keyids'.
|
||||
for keyid in keyids:
|
||||
try:
|
||||
|
|
@ -243,7 +241,11 @@ def load_keystore_from_keyfiles(directory_name, keyids, passwords):
|
|||
logger.warn(repr(full_filepath)+' contains an invalid key type.')
|
||||
continue
|
||||
|
||||
else:
|
||||
logger.warn('...no such directory. Keystore cannot be loaded.')
|
||||
|
||||
logger.info('Done.')
|
||||
|
||||
return loaded_keys
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue