mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Merge with origin/master.
This commit is contained in:
commit
21c19bcabd
2 changed files with 4 additions and 13 deletions
|
|
@ -895,13 +895,7 @@ def make_delegation(keystore_directory):
|
|||
delegated_targets_directory = _prompt(prompt, str)
|
||||
|
||||
# Verify 'delegated_targets_directory'.
|
||||
try:
|
||||
# normalize path
|
||||
delegated_targets_directory = os.path.abspath( delegated_targets_directory )
|
||||
tuf.repo.signerlib.check_directory(delegated_targets_directory)
|
||||
except (tuf.FormatError, tuf.Error), e:
|
||||
message = str(e)+'\n'
|
||||
raise tuf.RepositoryError(message)
|
||||
delegated_targets_directory = _check_directory(delegated_targets_directory)
|
||||
|
||||
# Get all the target roles and their respective keyids.
|
||||
# These keyids will let the user know which roles are currently known.
|
||||
|
|
|
|||
|
|
@ -721,7 +721,7 @@ def check_directory(directory):
|
|||
|
||||
<Arguments>
|
||||
directory:
|
||||
The directory (absolute path) to check.
|
||||
The directory to check.
|
||||
|
||||
<Exceptions>
|
||||
tuf.Error, if 'directory' could not be validated.
|
||||
|
|
@ -740,15 +740,12 @@ def check_directory(directory):
|
|||
# Raise 'tuf.FormatError' if there is a mismatch.
|
||||
tuf.formats.PATH_SCHEMA.check_match(directory)
|
||||
|
||||
directory = os.path.abspath(directory)
|
||||
|
||||
if not os.path.isabs(directory):
|
||||
raise tuf.Error(repr(directory)+' is not an absolute path.')
|
||||
|
||||
# Check if the directory exists.
|
||||
if not os.path.isdir(directory):
|
||||
raise tuf.Error(repr(directory)+' directory does not exist')
|
||||
|
||||
directory = os.path.abspath(directory)
|
||||
|
||||
return directory
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue