Skip to content

Commit fff5d75

Browse files
authored
{MYSQL} Remove parameter restriction for --high-availability and add breaking change annoucement (#31102)
* update * fix style * fix pylint
1 parent a6798ae commit fff5d75

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------
5+
from azure.cli.core.breaking_change import register_logic_breaking_change
6+
7+
register_logic_breaking_change('mysql flexible-server create', 'Update the validator',
8+
detail='the argument `--high-availability` will no longer accept value `SameZone` for '
9+
'new servers created in Business-Critical service tier '
10+
'if the region supports multiple zones.')
11+
register_logic_breaking_change('mysql flexible-server update', 'Update the validator',
12+
detail='the argument `--high-availability` will no longer accept value `SameZone` for '
13+
'new servers created in Business-Critical service tier '
14+
'if the region supports multiple zones.')

src/azure-cli/azure/cli/command_modules/mysql/custom.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from azure.cli.core.util import CLIError, sdk_no_wait, user_confirmation, run_cmd
2020
from azure.cli.core.local_context import ALL
2121
from azure.mgmt.mysqlflexibleservers import models
22-
from azure.cli.core.azclierror import ClientRequestError, RequiredArgumentMissingError, ArgumentUsageError, InvalidArgumentValueError, ValidationError
22+
from azure.cli.core.azclierror import ClientRequestError, RequiredArgumentMissingError, InvalidArgumentValueError, ValidationError
2323
from ._client_factory import get_mysql_flexible_management_client, cf_mysql_flexible_firewall_rules, cf_mysql_flexible_db, \
2424
cf_mysql_check_resource_availability, cf_mysql_check_resource_availability_without_location, cf_mysql_flexible_config, \
2525
cf_mysql_flexible_servers, cf_mysql_flexible_replica, cf_mysql_flexible_adadmin, cf_mysql_flexible_private_dns_zone_suffix_operations, cf_mysql_servers, \
@@ -1175,10 +1175,6 @@ def server_delete_func(cmd, client, resource_group_name, server_name, yes=None):
11751175

11761176

11771177
def flexible_server_restart(cmd, client, resource_group_name, server_name, fail_over=None):
1178-
instance = client.get(resource_group_name, server_name)
1179-
if fail_over is not None and instance.high_availability.mode != "ZoneRedundant":
1180-
raise ArgumentUsageError("Failing over can only be triggered for zone redundant servers.")
1181-
11821178
if fail_over is not None:
11831179
if fail_over != 'Forced':
11841180
raise InvalidArgumentValueError("Allowed failover parameters are 'Forced'.")

0 commit comments

Comments
 (0)