|
11 | 11 | # ANY KIND, either express or implied. See the License for the specific
|
12 | 12 | # language governing permissions and limitations under the License.
|
13 | 13 | import copy as python_copy
|
| 14 | +from functools import partial |
14 | 15 |
|
| 16 | +from botocore.context import with_current_context |
15 | 17 | from botocore.exceptions import ClientError
|
| 18 | +from botocore.useragent import register_feature_id |
16 | 19 |
|
17 | 20 | from boto3 import utils
|
18 | 21 | from boto3.s3.transfer import (
|
@@ -104,6 +107,7 @@ def object_summary_load(self, *args, **kwargs):
|
104 | 107 | self.meta.data = response
|
105 | 108 |
|
106 | 109 |
|
| 110 | +@with_current_context(partial(register_feature_id, 'S3_TRANSFER')) |
107 | 111 | def upload_file(
|
108 | 112 | self, Filename, Bucket, Key, ExtraArgs=None, Callback=None, Config=None
|
109 | 113 | ):
|
@@ -151,6 +155,7 @@ def upload_file(
|
151 | 155 | )
|
152 | 156 |
|
153 | 157 |
|
| 158 | +@with_current_context(partial(register_feature_id, 'S3_TRANSFER')) |
154 | 159 | def download_file(
|
155 | 160 | self, Bucket, Key, Filename, ExtraArgs=None, Callback=None, Config=None
|
156 | 161 | ):
|
@@ -368,6 +373,7 @@ def object_download_file(
|
368 | 373 | )
|
369 | 374 |
|
370 | 375 |
|
| 376 | +@with_current_context(partial(register_feature_id, 'S3_TRANSFER')) |
371 | 377 | def copy(
|
372 | 378 | self,
|
373 | 379 | CopySource,
|
@@ -579,6 +585,7 @@ def object_copy(
|
579 | 585 | )
|
580 | 586 |
|
581 | 587 |
|
| 588 | +@with_current_context(partial(register_feature_id, 'S3_TRANSFER')) |
582 | 589 | def upload_fileobj(
|
583 | 590 | self, Fileobj, Bucket, Key, ExtraArgs=None, Callback=None, Config=None
|
584 | 591 | ):
|
@@ -738,6 +745,7 @@ def object_upload_fileobj(
|
738 | 745 | )
|
739 | 746 |
|
740 | 747 |
|
| 748 | +@with_current_context(partial(register_feature_id, 'S3_TRANSFER')) |
741 | 749 | def download_fileobj(
|
742 | 750 | self, Bucket, Key, Fileobj, ExtraArgs=None, Callback=None, Config=None
|
743 | 751 | ):
|
|
0 commit comments