Ejemplo n.º 1
0
def _upload_multi_part(storage, connection, src, bucket, object_name):
    with AwsCli(storage) as awscli:
        objects = awscli.cp(srcs=[src],
                            bucket_name=bucket.name,
                            dest=object_name)

    return objects[0]
Ejemplo n.º 2
0
    def check_dependencies(self):
        if self.config.aws_cli_path == 'dynamic':
            aws_cli_path = AwsCli.find_aws_cli()
        else:
            aws_cli_path = self.config.aws_cli_path

        try:
            subprocess.check_call([aws_cli_path, "help"],
                                  stdout=PIPE,
                                  stderr=PIPE)
        except Exception:
            raise RuntimeError(
                "AWS cli doesn't seem to be installed on this system and is a "
                +
                "required dependency for the S3 backend. Please install it by running 'pip install awscli' "
                + "or 'sudo apt-get install awscli' and try again.")
Ejemplo n.º 3
0
def _download_multi_part(storage, connection, src, bucket, blob_dest):
    with AwsCli(storage) as awscli:
        awscli.cp_download(src=src, bucket_name=bucket.name, dest=blob_dest)