Skip to content

Commit

Permalink
storing the document in the file key
Browse files Browse the repository at this point in the history
  • Loading branch information
douglascamata committed Aug 31, 2012
1 parent 45c4ed5 commit 3941d30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nsicloudooomanager/http.py
Expand Up @@ -122,7 +122,7 @@ def post(self):

if request_as_json.get('doc'):
doc = request_as_json.get('doc')
to_granulate_doc = {"doc":doc, "granulated":False}
to_granulate_doc = {"file":doc}
to_granulate_uid = yield self._pre_store_in_sam(to_granulate_doc)
log.msg("Granulating a doc...")
elif request_as_json.get('sam_uid'):
Expand Down
5 changes: 3 additions & 2 deletions nsicloudooomanager/tasks.py
Expand Up @@ -42,7 +42,7 @@ def run(self, task_queue, uid, filename, callback_url, callback_verb, doc_link,
else:
# when the worker receives a SAM uid
response = loads(self._get_from_sam(uid).body)
self._original_doc = response["data"]["doc"]
self._original_doc = response["data"]["file"]
self._old_data = response["data"]
if self._old_data.has_key("granulated"):
del self._old_data["granulated"]
Expand Down Expand Up @@ -96,11 +96,12 @@ def _download_doc(self, doc_link):
def _process_doc(self):
self._granulate_doc()
new_doc = {
'doc': self._original_doc, 'granulated':True, 'grains_keys':self._grains_keys,
'file': self._original_doc, 'granulated':True, 'grains_keys':self._grains_keys,
'thumbnail_key':self._thumbnail_key
}
if hasattr(self, '_old_data'):
new_doc.update(self._old_data)
print new_doc['granulated']
self._sam.post(key=self._doc_uid, value=new_doc)

def _granulate_doc(self):
Expand Down

0 comments on commit 3941d30

Please sign in to comment.