Skip to content

Commit 0d21ec8

Browse files
authored
[Storage] az storage file list: Fix file list for nfs shares, as --include is not supported (#32268)
1 parent 8642715 commit 0d21ec8

File tree

6 files changed

+10947
-9692
lines changed

6 files changed

+10947
-9692
lines changed

src/azure-cli/azure/cli/command_modules/storage/operations/file.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,13 @@ def create_file_url(client, protocol=None, **kwargs):
9393
def list_share_files(cmd, client, directory_name=None, timeout=None, exclude_dir=False, exclude_extended_info=False,
9494
num_results=None, marker=None):
9595
from ..track2_util import list_generator
96-
include = [] if exclude_extended_info else ["timestamps", "Etag", "Attributes", "PermissionKey"]
96+
include = None
97+
share_properties = client.get_share_properties()
98+
if share_properties.protocols == ['SMB']:
99+
include = [] if exclude_extended_info else ["timestamps", "Etag", "Attributes", "PermissionKey"]
100+
elif share_properties.protocols == ['NFS']:
101+
if exclude_extended_info:
102+
logger.warning('--exclude-extended-info is not supported for NFS shares.')
97103
generator = client.list_directories_and_files(directory_name=directory_name, include=include,
98104
timeout=timeout, results_per_page=num_results)
99105
pages = generator.by_page(continuation_token=marker)

0 commit comments

Comments
 (0)