New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue#108] Refactor Storage API #119

Merged
merged 22 commits into from Jul 2, 2017

Fix import.

  • Loading branch information...
ooq committed Jun 14, 2017
commit 4e0c57d25677c791f49e8c9e4e2a6a87c7e9852a
Copy path View file
@@ -1,14 +1,5 @@
import boto3
import os
import sys
import botocore
import json
if sys.version_info > (3, 0):
from .exceptions import StorageNoSuchKeyError
else:
from exceptions import StorageNoSuchKeyError
from .exceptions import *
class S3Service(object):
"""
Copy path View file
@@ -1,13 +1,8 @@
import os
import sys
import json
import pywren.storage.storage_utils as storage_utils
import pywren.storage.exceptions as exceptions
if sys.version_info > (3, 0):
from .s3_service import S3Service
else:
from s3_service import S3Service
from .storage_utils import *
from .exceptions import *
from .s3_service import S3Service
class Storage(object):
@@ -79,7 +74,7 @@ def get_call_status(self, callset_id, call_id):
try:
data = self.service_handler.get_object(status_key)
return json.loads(data.decode('ascii'))
except exceptions.StorageNoSuchKeyError:
except StorageNoSuchKeyError:
return None
def get_call_output(self, callset_id, call_id):
@@ -92,8 +87,8 @@ def get_call_output(self, callset_id, call_id):
output_key = storage_utils.create_output_key(self.prefix, callset_id, call_id)
try:
return self.service_handler.get_object(output_key)
except exceptions.StorageNoSuchKeyError:
raise exceptions.StorageOutputNotFoundError(callset_id, call_id)
except StorageNoSuchKeyError:
raise StorageOutputNotFoundError(callset_id, call_id)
def get_runtime_info(runtime_config):
ProTip! Use n and p to navigate between commits in a pull request.