Skip to content

Commit

Permalink
Chunk got lost in merge
Browse files Browse the repository at this point in the history
  • Loading branch information
wonderslug committed Dec 12, 2014
1 parent 7b8c746 commit a1b4f86
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions util/mongodb_binaries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ class BinariesManager(object):

def __init__(self, directory):
self.directory = directory
self.current_download = None
self.requested_criteria = None

def update(self, criteria):
"""
Expand All @@ -152,7 +154,8 @@ def update(self, criteria):
# see if we need to actually do the download based on
# the check file and the directory
repo = get_repo(criteria=criteria)
download = repo.get_available()
self.current_download = repo.get_available()
self.requested_criteria = repo.criteria

do_download = False
if current_binaries is not None:
Expand All @@ -171,11 +174,11 @@ def update(self, criteria):
if do_download:
# make sure we really need to download
if (current_binaries is None
or current_binaries.hash != download.hash):
if download.download():
download.extract_to(self.directory)
download.clean()
repo.criteria.hash = download.hash
or current_binaries.hash != self.current_download.hash):
if self.current_download.download():
self.current_download.extract_to(self.directory)
self.current_download.clean()
repo.criteria.hash = self.current_download.hash
with open(current_binaries_file, 'wb+') as output:
pickle.dump(repo.criteria, output)

0 comments on commit a1b4f86

Please sign in to comment.