Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Storage] az storage fs undelete-path: Encode --deleted-path-name automatically #23113

Merged
merged 1 commit into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/azure-cli/azure/cli/command_modules/storage/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2286,6 +2286,10 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
help="File system name.", required=True)
c.extra('timeout', timeout_type)

with self.argument_context('storage fs undelete-path') as c:
from ._validators import encode_deleted_path
c.argument('deleted_path_name', validator=encode_deleted_path)

with self.argument_context('storage fs list-deleted-path') as c:
c.argument('path_prefix', help='Filter the results to return only paths under the specified path.')
c.argument('num_results', type=int, help='Specify the maximum number to return.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2206,3 +2206,8 @@ def validate_blob_arguments(namespace):
if not namespace.blob_url and not all([namespace.blob_name, namespace.container_name]):
raise RequiredArgumentMissingError(
"Please specify --blob-url or combination of blob name, container name and storage account arguments.")


def encode_deleted_path(namespace):
from urllib.parse import quote
namespace.deleted_path_name = quote(namespace.deleted_path_name)
Loading