MCPcopy Create free account
hub / github.com/aws/aws-cli / _submit

Method _submit

awscli/s3transfer/copies.py:85–150  ·  view source on GitHub ↗

:param client: The client associated with the transfer manager :type config: s3transfer.manager.TransferConfig :param config: The transfer config associated with the transfer manager :type osutil: s3transfer.utils.OSUtil :param osutil: The os ut

(
        self, client, config, osutil, request_executor, transfer_future
    )

Source from the content-addressed store, hash-verified

83 ]
84
85 def _submit(
86 self, client, config, osutil, request_executor, transfer_future
87 ):
88 """
89 :param client: The client associated with the transfer manager
90
91 :type config: s3transfer.manager.TransferConfig
92 :param config: The transfer config associated with the transfer
93 manager
94
95 :type osutil: s3transfer.utils.OSUtil
96 :param osutil: The os utility associated to the transfer manager
97
98 :type request_executor: s3transfer.futures.BoundedExecutor
99 :param request_executor: The request executor associated with the
100 transfer manager
101
102 :type transfer_future: s3transfer.futures.TransferFuture
103 :param transfer_future: The transfer future associated with the
104 transfer request that tasks are being submitted for
105 """
106 if (
107 transfer_future.meta.size is None
108 or transfer_future.meta.etag is None
109 ):
110 # If a size was not provided figure out the size for the
111 # user. Note that we will only use the client provided to
112 # the TransferManager. If the object is outside of the region
113 # of the client, they may have to provide the file size themselves
114 # with a completely new client.
115 call_args = transfer_future.meta.call_args
116 head_object_request = (
117 self._get_head_object_request_from_copy_source(
118 call_args.copy_source
119 )
120 )
121 extra_args = call_args.extra_args
122
123 # Map any values that may be used in the head object that is
124 # used in the copy object
125 for param, value in extra_args.items():
126 if param in self.EXTRA_ARGS_TO_HEAD_ARGS_MAPPING:
127 head_object_request[
128 self.EXTRA_ARGS_TO_HEAD_ARGS_MAPPING[param]
129 ] = value
130
131 response = call_args.source_client.head_object(
132 **head_object_request
133 )
134 transfer_future.meta.provide_transfer_size(
135 response['ContentLength']
136 )
137 # Provide an etag to ensure a stored object is not modified
138 # during a multipart copy.
139 transfer_future.meta.provide_object_etag(response.get('ETag'))
140
141 # If it is greater than threshold do a multipart copy, otherwise
142 # do a regular copy object.

Callers

nothing calls this directly

Tested by

no test coverage detected