Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
Merge pull request #925 from oremj/bug896846_tempclean
Browse files Browse the repository at this point in the history
Bug 896846
  • Loading branch information
cvan committed Jul 30, 2013
2 parents 74c2f3e + 7a32c90 commit 7b28703
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/crypto/packaged.py
Expand Up @@ -25,6 +25,14 @@ class SigningError(Exception):


def sign_app(src, dest, ids, reviewer=False):
tempname = tempfile.mktemp()
try:
return _sign_app(src, dest, ids, reviewer, tempname)
finally:
os.unlink(tempname)


def _sign_app(src, dest, ids, reviewer, tempname):
"""
Generate a manifest and signature and send signature to signing server to
be signed.
Expand All @@ -37,7 +45,6 @@ def sign_app(src, dest, ids, reviewer=False):
return

# Extract necessary info from the archive
tempname = tempfile.mktemp()
try:
jar = JarExtractor(
storage.open(src, 'r'), tempname,
Expand Down Expand Up @@ -81,7 +88,7 @@ def sign_app(src, dest, ids, reviewer=False):
with storage.open(dest, 'w') as destf:
tempf = open(tempname)
shutil.copyfileobj(tempf, destf)
os.unlink(tempname)


def _get_endpoint(reviewer=False):
"""
Expand Down

0 comments on commit 7b28703

Please sign in to comment.