Coder Social home page Coder Social logo

madeira's People

Contributors

mxmader avatar

Watchers

 avatar  avatar

madeira's Issues

make AWS service clients visible at class level

there's no practical reason to make boto3 client objects "private" in the context of python classes in this SDK. only makes exception handling more awkward by propagating warnings regarding access to private properties in linters/IDEs.

Project documentation

  • readthedocs.io - reStructuredText / sphinx
  • docstring format for the above - follow suit of requests package

S3_Wrapper.does_bucket_exist() unhandled exception when bucket exists but owned by other

In [5]: s3w.does_bucket_exist('foo')                                                                                                 
---------------------------------------------------------------------------
ClientError                               Traceback (most recent call last)
<ipython-input-5-5f39b7a638b4> in <module>
----> 1 s3w.does_bucket_exist('foo')

~/Development/madeira/madeira/s3.py in does_bucket_exist(self, bucket_name)
     99             # something else went wrong when checking for the bucket's existence
    100             else:
--> 101                 raise e
    102 
    103     def get_all_buckets(self):

~/Development/madeira/madeira/s3.py in does_bucket_exist(self, bucket_name)
     89     def does_bucket_exist(self, bucket_name):
     90         try:
---> 91             self._s3_resource.meta.client.head_bucket(Bucket=bucket_name)
     92             return True
     93         except botocore.exceptions.ClientError as e:

~/.local/lib/python3.8/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
    355                     "%s() only accepts keyword arguments." % py_operation_name)
    356             # The "self" in this scope is referring to the BaseClient.
--> 357             return self._make_api_call(operation_name, kwargs)
    358 
    359         _api_call.__name__ = str(py_operation_name)

~/.local/lib/python3.8/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
    674             error_code = parsed_response.get("Error", {}).get("Code")
    675             error_class = self.exceptions.from_code(error_code)
--> 676             raise error_class(parsed_response, operation_name)
    677         else:
    678             return parsed_response

ClientError: An error occurred (403) when calling the HeadBucket operation: Forbidden

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.