11
11
12
12
from azure .core .polling import async_poller
13
13
from azure .core .async_paging import AsyncItemPaged
14
-
14
+ from azure . core . pipeline import AsyncPipeline
15
15
from azure .core .tracing .decorator import distributed_trace
16
16
from azure .core .tracing .decorator_async import distributed_trace_async
17
17
from .._parser import _get_file_permission , _datetime_to_str
20
20
from .._generated .aio import AzureFileStorage
21
21
from .._generated .version import VERSION
22
22
from .._generated .models import StorageErrorException
23
- from .._shared .base_client_async import AsyncStorageAccountHostsMixin
23
+ from .._shared .base_client_async import AsyncStorageAccountHostsMixin , AsyncTransportWrapper
24
24
from .._shared .policies_async import ExponentialRetry
25
25
from .._shared .request_handlers import add_metadata_headers
26
26
from .._shared .response_handlers import return_response_headers , process_storage_error
@@ -112,10 +112,15 @@ def get_file_client(self, file_name, **kwargs):
112
112
"""
113
113
if self .directory_path :
114
114
file_name = self .directory_path .rstrip ('/' ) + "/" + file_name
115
+
116
+ _pipeline = AsyncPipeline (
117
+ transport = AsyncTransportWrapper (self ._pipeline ._transport ), # pylint: disable = protected-access
118
+ policies = self ._pipeline ._impl_policies # pylint: disable = protected-access
119
+ )
115
120
return FileClient (
116
121
self .url , file_path = file_name , share_name = self .share_name , snapshot = self .snapshot ,
117
122
credential = self .credential , _hosts = self ._hosts , _configuration = self ._config ,
118
- _pipeline = self . _pipeline , _location_mode = self ._location_mode , loop = self ._loop , ** kwargs )
123
+ _pipeline = _pipeline , _location_mode = self ._location_mode , loop = self ._loop , ** kwargs )
119
124
120
125
def get_subdirectory_client (self , directory_name , ** kwargs ):
121
126
# type: (str, Any) -> DirectoryClient
@@ -138,10 +143,15 @@ def get_subdirectory_client(self, directory_name, **kwargs):
138
143
:caption: Gets the subdirectory client.
139
144
"""
140
145
directory_path = self .directory_path .rstrip ('/' ) + "/" + directory_name
146
+
147
+ _pipeline = AsyncPipeline (
148
+ transport = AsyncTransportWrapper (self ._pipeline ._transport ), # pylint: disable = protected-access
149
+ policies = self ._pipeline ._impl_policies # pylint: disable = protected-access
150
+ )
141
151
return DirectoryClient (
142
152
self .url , share_name = self .share_name , directory_path = directory_path , snapshot = self .snapshot ,
143
153
credential = self .credential , _hosts = self ._hosts , _configuration = self ._config ,
144
- _pipeline = self . _pipeline , _location_mode = self ._location_mode , loop = self ._loop , ** kwargs )
154
+ _pipeline = _pipeline , _location_mode = self ._location_mode , loop = self ._loop , ** kwargs )
145
155
146
156
@distributed_trace_async
147
157
async def create_directory (self , ** kwargs ): # type: ignore
0 commit comments