コード例 #1
0
 def _hashTestFile(self, url):
     import boto
     from toil.jobStores.googleJobStore import GoogleJobStore
     projectID, uri = GoogleJobStore._getResources(urlparse.urlparse(url))
     uri = boto.storage_uri(uri)
     contents = uri.get_contents_as_string(headers=self.headers)
     return hashlib.md5(contents).hexdigest()
コード例 #2
0
 def _hashTestFile(self, url):
     import boto
     from toil.jobStores.googleJobStore import GoogleJobStore
     projectID, uri = GoogleJobStore._getResources(urlparse.urlparse(url))
     uri = boto.storage_uri(uri)
     contents = uri.get_contents_as_string(headers=self.headers)
     return hashlib.md5(contents).hexdigest()
コード例 #3
0
ファイル: jobStoreTest.py プロジェクト: joelarmstrong/toil
 def _hashUrl(url):
     import boto
     from toil.jobStores.googleJobStore import GoogleJobStore
     projectID, uri = GoogleJobStore._getResources(urlparse.urlparse(url))
     return hashlib.md5(
         boto.storage_uri(uri).get_contents_as_string(
             headers=GoogleJobStoreTest.headers)).hexdigest()
コード例 #4
0
ファイル: jobStoreTest.py プロジェクト: broadinstitute/toil
 def _cleanUpExternalStore(url):
     import boto
     from toil.jobStores.googleJobStore import GoogleJobStore
     projectID, uri = GoogleJobStore._getResources(urlparse.urlparse(url))
     uri = boto.storage_uri(uri)
     headers = {"x-goog-project-id": projectID}
     bucket = uri.get_bucket(headers=headers, validate=True)
     if bucket is not None:
         while True:
             for key in bucket.list():
                 try:
                     key.delete()
                 except boto.exception.GSResponseError as e:
                     if e.status == 404:
                         pass
                     else:
                         raise e
             try:
                 uri.delete_bucket()
             except boto.exception.GSResponseError as e:
                     if e.status == 404:
                         break
                     else:
                         continue
コード例 #5
0
ファイル: jobStoreTest.py プロジェクト: joelarmstrong/toil
 def _cleanUpExternalStore(url):
     import boto
     from toil.jobStores.googleJobStore import GoogleJobStore
     projectID, uri = GoogleJobStore._getResources(urlparse.urlparse(url))
     uri = boto.storage_uri(uri)
     headers = {"x-goog-project-id": projectID}
     bucket = uri.get_bucket(headers=headers, validate=True)
     if bucket is not None:
         while True:
             for key in bucket.list():
                 try:
                     key.delete()
                 except boto.exception.GSResponseError as e:
                     if e.status == 404:
                         pass
                     else:
                         raise e
             try:
                 uri.delete_bucket()
             except boto.exception.GSResponseError as e:
                 if e.status == 404:
                     break
                 else:
                     continue
コード例 #6
0
ファイル: jobStoreTest.py プロジェクト: broadinstitute/toil
 def _hashUrl(url):
     import boto
     from toil.jobStores.googleJobStore import GoogleJobStore
     projectID, uri = GoogleJobStore._getResources(urlparse.urlparse(url))
     return hashlib.md5(boto.storage_uri(uri).get_contents_as_string(headers=GoogleJobStoreTest.headers)).hexdigest()