Skip to content

Commit

Permalink
[Storage] Update rename_directory lease param name (#23411)
Browse files Browse the repository at this point in the history
  • Loading branch information
jalauzon-msft authored Mar 8, 2022
1 parent 4513dbd commit 5b6ff12
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def rename_directory(
:paramtype file_last_write_time:~datetime.datetime or str
:keyword Dict[str,str] metadata:
A name-value pair to associate with a file storage object.
:keyword lease:
:keyword destination_lease:
Required if the destination file has an active lease. Value can be a ShareLeaseClient object
or the lease ID as a string.
:paramtype lease: ~azure.storage.fileshare.ShareLeaseClient or str
Expand Down Expand Up @@ -403,14 +403,14 @@ def rename_directory(
headers = kwargs.pop('headers', {})
headers.update(add_metadata_headers(metadata))

access_conditions = get_dest_access_conditions(kwargs.pop('lease', None))
destination_access_conditions = get_dest_access_conditions(kwargs.pop('destination_lease', None))

try:
new_directory_client._client.directory.rename( # pylint: disable=protected-access
self.url,
timeout=timeout,
replace_if_exists=overwrite,
destination_lease_access_conditions=access_conditions,
destination_lease_access_conditions=destination_access_conditions,
headers=headers,
**kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ async def rename_directory(
:paramtype file_last_write_time:~datetime.datetime or str
:keyword Dict[str,str] metadata:
A name-value pair to associate with a file storage object.
:keyword lease:
:keyword destination_lease:
Required if the destination file has an active lease. Value can be a ShareLeaseClient object
or the lease ID as a string.
:paramtype lease: ~azure.storage.fileshare.ShareLeaseClient or str
Expand Down Expand Up @@ -283,14 +283,14 @@ async def rename_directory(
headers = kwargs.pop('headers', {})
headers.update(add_metadata_headers(metadata))

access_conditions = get_dest_access_conditions(kwargs.pop('lease', None))
destination_access_conditions = get_dest_access_conditions(kwargs.pop('destination_lease', None))

try:
await new_directory_client._client.directory.rename( # pylint: disable=protected-access
self.url,
timeout=timeout,
replace_if_exists=overwrite,
destination_lease_access_conditions=access_conditions,
destination_lease_access_conditions=destination_access_conditions,
headers=headers,
**kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ def test_rename_directory_dest_lease(self, storage_account_name, storage_account
# Act
new_directory = source_directory.rename_directory(
dest_directory.directory_path + '/' + dest_file.file_name,
overwrite=True, lease=lease)
overwrite=True, destination_lease=lease)

# Assert
props = new_directory.get_directory_properties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ async def test_rename_directory_dest_lease(self, storage_account_name, storage_a
# Act
new_directory = await source_directory.rename_directory(
dest_directory.directory_path + '/' + dest_file.file_name,
overwrite=True, lease=lease)
overwrite=True, destination_lease=lease)

# Assert
props = await new_directory.get_directory_properties()
Expand Down

0 comments on commit 5b6ff12

Please sign in to comment.