This makes the AWS S3 setup dead simple: just put in a awsbucket name of
your choosing, set the AWS credentials, and it'll do the rest, whether the
bucket exists already or not. S3 buckets are trivial to delete too, in
case of error: `s3cmd rb s3://mybadbucketname`.
import libcloud.security
libcloud.security.VERIFY_SSL_CERT = True
import libcloud.security
libcloud.security.VERIFY_SSL_CERT = True
- from libcloud.storage.types import Provider
+ from libcloud.storage.types import Provider, ContainerDoesNotExistError
from libcloud.storage.providers import get_driver
if 'awsaccesskeyid' not in config or 'awssecretkey' not in config:
from libcloud.storage.providers import get_driver
if 'awsaccesskeyid' not in config or 'awssecretkey' not in config:
cls = get_driver(Provider.S3)
driver = cls(config['awsaccesskeyid'], config['awssecretkey'])
cls = get_driver(Provider.S3)
driver = cls(config['awsaccesskeyid'], config['awssecretkey'])
- container = driver.get_container(container_name=awsbucket)
+ try:
+ container = driver.get_container(container_name=awsbucket)
+ except ContainerDoesNotExistError:
+ container = driver.create_container(container_name=awsbucket)
+ logging.info('Created new container "' + container.name + '"')
upload_dir = 'fdroid/' + repo_section
if options.verbose:
upload_dir = 'fdroid/' + repo_section
if options.verbose:
'paramiko',
'PIL',
'python-magic',
'paramiko',
'PIL',
'python-magic',
- 'apache-libcloud >= 0.5',
+ 'apache-libcloud >= 0.14.1',
],
classifiers=[
'Development Status :: 3 - Alpha',
],
classifiers=[
'Development Status :: 3 - Alpha',