sregistry/main/google_storage/__init__.py
def _get_bucket(self):
        '''get a bucket based on a bucket name. If it doesn't exist, create it.
        '''

        # Case 1: The bucket already exists
        try:
            self._bucket = self._bucket_service.get_bucket(self._bucket_name)

        # Case 2: The bucket needs to be created
        except google.cloud.exceptions.NotFound:
            self._bucket = self._bucket_service.create_bucket(self._bucket_name)

        # Case 3: The bucket name is already taken
        except:
            bot.error('Cannot get or create %s' %self._bucket_name)
            sys.exit(1)

        return self._bucket
def _get_bucket(self):
        '''get a bucket based on a bucket name. If it doesn't exist, create it.
        '''

        # Case 1: The bucket already exists
        try:
            self._bucket = self._bucket_service.get_bucket(self._bucket_name)

        # Case 2: The bucket needs to be created
        except google.cloud.exceptions.NotFound:
            self._bucket = self._bucket_service.create_bucket(self._bucket_name)

        # Case 3: The bucket name is already taken
        except:
            bot.error('Cannot get or create %s' %self._bucket_name)
            sys.exit(1)

        return self._bucket
def _get_bucket ( self ) : # Case 1: The bucket already exists try : self . _bucket = self . _bucket_service . get_bucket ( self . _bucket_name ) # Case 2: The bucket needs to be created except google . cloud . exceptions . NotFound : self . _bucket = self . _bucket_service . create_bucket ( self . _bucket_name ) # Case 3: The bucket name is already taken except : bot . error ( 'Cannot get or create %s' % self . _bucket_name ) sys . exit ( 1 ) return self . _bucket
get a bucket based on a bucket name. If it doesn't exist, create it.
get a bucket based on a bucket name . If it doesn t exist create it .