From 984995382f5ab319dc8e7773d0a01574f4fcc7cb Mon Sep 17 00:00:00 2001 From: jiasli <4003950+jiasli@users.noreply.github.com> Date: Thu, 7 Apr 2022 16:06:39 +0800 Subject: [PATCH 1/2] netappfiles --- src/azure-cli/azure/cli/command_modules/netappfiles/custom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/netappfiles/custom.py b/src/azure-cli/azure/cli/command_modules/netappfiles/custom.py index d9f0f7323ab..19f29a6c380 100644 --- a/src/azure-cli/azure/cli/command_modules/netappfiles/custom.py +++ b/src/azure-cli/azure/cli/command_modules/netappfiles/custom.py @@ -417,7 +417,7 @@ def snapshot_restore_files(client, resource_group_name, account_name, pool_name, file_paths=file_paths, destination_path=destination_path ) - client.begin_restore_files(resource_group_name, account_name, pool_name, volume_name, snapshot_name, body) + return client.begin_restore_files(resource_group_name, account_name, pool_name, volume_name, snapshot_name, body) # ---- SNAPSHOT POLICIES ---- From 2aff2247868da859e383684b18adc9fda2cdf450 Mon Sep 17 00:00:00 2001 From: jiasli <4003950+jiasli@users.noreply.github.com> Date: Thu, 7 Apr 2022 16:26:36 +0800 Subject: [PATCH 2/2] test_restore_file --- .../netappfiles/tests/latest/test_snapshot_commands.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/azure-cli/azure/cli/command_modules/netappfiles/tests/latest/test_snapshot_commands.py b/src/azure-cli/azure/cli/command_modules/netappfiles/tests/latest/test_snapshot_commands.py index fdbd8d15a68..b5f610a39b6 100644 --- a/src/azure-cli/azure/cli/command_modules/netappfiles/tests/latest/test_snapshot_commands.py +++ b/src/azure-cli/azure/cli/command_modules/netappfiles/tests/latest/test_snapshot_commands.py @@ -2,6 +2,9 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- + +import unittest + from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer from azure.cli.testsdk.decorators import serial_test @@ -176,6 +179,7 @@ def test_get_snapshot(self): snapshot_from_id = self.cmd("az netappfiles snapshot show --ids %s" % snapshot['id']).get_output_in_json() assert snapshot_from_id['name'] == account_name + '/' + pool_name + '/' + volume_name + '/' + snapshot_name + @unittest.skip('This test requires southcentralusstage and cannot be run with public cloud.') @ResourceGroupPreparer(name_prefix='cli_netappfiles_test_snapshot_', additional_tags={'owner': 'cli_test'}) def test_restore_file(self): # create volume