Skip to content

Commit 53548ca

Browse files
committed
stop directory walk before appending share root
1 parent 5259c30 commit 53548ca

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • src/azure-cli/azure/cli/command_modules/storage/operations

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,8 @@ def _make_directory_in_files_share(file_service, directory_path, existing_dirs=N
512512

513513
parents = [directory_path]
514514
p = os.path.dirname(directory_path)
515-
while p and p != parents[-1]:
515+
# Stop once p reaches the root (dirname(p) == p), so the share root is never queued for creation
516+
while p and p != os.path.dirname(p):
516517
parents.append(p)
517518
p = os.path.dirname(p)
518519

0 commit comments

Comments
 (0)