Skip to content

Commit

Permalink
Fixed a bug in signercli.py where the absolute path of a directory wa…
Browse files Browse the repository at this point in the history
…s not properly set. Updated signerlib.py
  • Loading branch information
vladimir-v-diaz committed Feb 26, 2013
1 parent 4266591 commit ef53ca6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
6 changes: 1 addition & 5 deletions tuf/repo/signercli.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,11 +895,7 @@ def make_delegation(keystore_directory):
delegated_targets_directory = _prompt(prompt, str)

# Verify 'delegated_targets_directory'.
try:
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.
Expand Down
9 changes: 3 additions & 6 deletions tuf/repo/signerlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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


Expand Down

0 comments on commit ef53ca6

Please sign in to comment.