Skip to content

Commit

Permalink
Raise exceptions instead of returning
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianchifor committed Mar 22, 2018
1 parent 20a5c30 commit b1201da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kapitan/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ def deep_get(x, keys):
for i in output:
print('{0!s:{l}} {1!s}'.format(*i, l=maxlenght + 2))


def get_directory_hash(directory):
'''
Compute a sha256 hash for the file contents of a directory
Expand All @@ -231,10 +232,10 @@ def get_directory_hash(directory):
hash.update(sha256(f.read().encode("UTF-8")).hexdigest().encode("UTF-8"))
except Exception as e:
logger.error("utils.get_directory_hash failed to open %s: %s", file_path, str(e))
return -2
raise

except Exception as e:
logger.error("utils.get_directory_hash failed: %s", str(e))
return -2
raise

return hash.hexdigest()

0 comments on commit b1201da

Please sign in to comment.