Skip to content

Commit 9f39214

Browse files
zubairabidZubair Abid
andauthored
[Hotfix][dataprotection] Fix regression to AKS restore initialization caused by PR #9834. (#9448)
* Fix issue to AKS restores caused by #9834. * Add version * Fix azdev style --------- Co-authored-by: Zubair Abid <[email protected]>
1 parent 1fc0456 commit 9f39214

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

src/dataprotection/HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
33
Release History
44
===============
5+
6+
1.7.1
7+
+++++
8+
* `az dataprotection backup-instance restore initialize-for-item-recovery`: Fixed a bug where the command would fail for AKS Scenarios.
9+
510
1.7.0
611
+++++
712
* Added support for Azure Data Lake Storage as a backup datasource.

src/dataprotection/azext_dataprotection/manual/helpers.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -543,22 +543,24 @@ def get_resource_criteria_list(datasource_type, restore_configuration, container
543543
raise RequiredArgumentMissingError("Please input parameter restore_configuration for AKS cluster restore.\n\
544544
Use command initialize-restoreconfig for creating the RestoreConfiguration")
545545
restore_criteria_list.append(restore_criteria)
546-
else:
547-
# For non-AKS workloads (blobs (non-vaulted)), we need either a prefix-pattern or a container-list. Accordingly, the restore
548-
# criteria's min_matching_value and max_matching_value are set. We need to provide one, but can't provide both
549-
# vaulted blobs also take container list or a different prefix pattern format. These also need to be exclusive.
550-
container_list_present = container_list is not None
551-
prefix_pattern_present = (from_prefix_pattern is not None or to_prefix_pattern is not None)
552-
vaulted_pattern_present = vaulted_blob_prefix_pattern is not None
546+
return restore_criteria_list
547+
548+
# implicit else:
549+
# For non-AKS workloads (blobs (non-vaulted)), we need either a prefix-pattern or a container-list. Accordingly, the restore
550+
# criteria's min_matching_value and max_matching_value are set. We need to provide one, but can't provide both
551+
# vaulted blobs also take container list or a different prefix pattern format. These also need to be exclusive.
552+
container_list_present = container_list is not None
553+
prefix_pattern_present = (from_prefix_pattern is not None or to_prefix_pattern is not None)
554+
vaulted_pattern_present = vaulted_blob_prefix_pattern is not None
553555

554-
if are_multiple_true(container_list_present, prefix_pattern_present, vaulted_pattern_present):
555-
raise MutuallyExclusiveArgumentError("Please specify only one of container list, prefix pattern, or "
556-
"vaulted blob's prefix patterns")
556+
if are_multiple_true(container_list_present, prefix_pattern_present, vaulted_pattern_present):
557+
raise MutuallyExclusiveArgumentError("Please specify only one of container list, prefix pattern, or "
558+
"vaulted blob's prefix patterns")
557559

558-
if not any([container_list_present, prefix_pattern_present, vaulted_pattern_present]):
559-
raise RequiredArgumentMissingError("Provide ContainersList or Prefixes for Item Level Recovery")
560+
if not any([container_list_present, prefix_pattern_present, vaulted_pattern_present]):
561+
raise RequiredArgumentMissingError("Provide ContainersList or Prefixes for Item Level Recovery")
560562

561-
# Process based on the provided parameter type
563+
# Process based on the provided parameter type
562564
if container_list_present:
563565
return _process_container_list(container_list, recovery_point_id)
564566

src/dataprotection/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from setuptools import setup, find_packages
1111

1212
# HISTORY.rst entry.
13-
VERSION = '1.7.0'
13+
VERSION = '1.7.1'
1414

1515
# The full list of classifiers is available at
1616
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)