From cf6f017b91f6db995f124d7b8e1e9c0ccace23e9 Mon Sep 17 00:00:00 2001 From: "Steve L. Nyemba" Date: Tue, 26 Sep 2017 15:54:26 -0500 Subject: [PATCH] S3 - Bug fix? Not sure --- transport.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) mode change 100644 => 100755 transport.py diff --git a/transport.py b/transport.py old mode 100644 new mode 100755 index ea13bff..c6bd085 --- a/transport.py +++ b/transport.py @@ -646,7 +646,7 @@ class s3 : """ try: self.s3 = boto.connect_s3(args['access_key'],args['secret_key']) - self.bucket = self.s3.get_bucket(args['bucket']) if 'bucket' in args else None + self.bucket = self.s3.get_bucket(args['bucket'].strip(),validate=False) if 'bucket' in args else None # self.path = args['path'] self.filter = args['filter'] if 'filter' in args else None self.filename = args['file'] if 'file' in args else None @@ -747,9 +747,11 @@ class DataSource: return self.Input.read(size) def write(self,**args): self.Output.write(**args) -# conf = json.loads(open('conf.json').read()) -# x = s3Reader( dict(conf,**{'bucket':'com.phi.sample.data','file':'Sample-Spreadsheet-5000-rows.csv'})) - +conf = json.loads(open('config.json').read()) +#x = s3Reader( dict(conf,**{'bucket':'com.phi.sample.data','file':'Sample-Spreadsheet-5000-rows.csv'})) +x = s3Reader(conf) +print conf +print x.bucket.get_all_keys() # r = x.read() # for item in r : # print item