From c083090816c8cbe899dd9d18468873b214d2cf0b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Dec 2022 16:01:22 +0530 Subject: [PATCH] adding breaking change messages --- .../azure/cli/command_modules/servicebus/_params.py | 8 ++++++++ .../azure/cli/command_modules/servicebus/custom.py | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/azure-cli/azure/cli/command_modules/servicebus/_params.py b/src/azure-cli/azure/cli/command_modules/servicebus/_params.py index 8fbde6bebcc..2b316c82d3f 100644 --- a/src/azure-cli/azure/cli/command_modules/servicebus/_params.py +++ b/src/azure-cli/azure/cli/command_modules/servicebus/_params.py @@ -103,6 +103,14 @@ def load_arguments_sb(self, _): c.argument('forward_dead_lettered_messages_to', help='Queue/Topic name to forward the Dead Letter message') c.argument('enable_batched_operations', arg_type=get_three_state_flag(), help='Allow server-side batched operations.') + with self.argument_context('servicebus queue update') as c: + c.argument('enable_partitioning', arg_type=get_three_state_flag(), + help='A boolean value that indicates whether the queue is to be partitioned across multiple message brokers.', deprecate_info=c.deprecate(hide=True, expiration='2.45.0')) + c.argument('requires_session', options_list=['--enable-session'], arg_type=get_three_state_flag(), help='A boolean value indicating whether the queue supports the concept of sessions.', deprecate_info=c.deprecate(hide=True, expiration='2.45.0')) + c.argument('requires_duplicate_detection', options_list=['--enable-duplicate-detection'], + arg_type=get_three_state_flag(), + help='A boolean value indicating if this queue requires duplicate detection.', deprecate_info=c.deprecate(hide=True, expiration='2.45.0')) + with self.argument_context('servicebus queue list') as c: c.argument('namespace_name', id_part=None, options_list=['--namespace-name'], help='Name of Namespace') diff --git a/src/azure-cli/azure/cli/command_modules/servicebus/custom.py b/src/azure-cli/azure/cli/command_modules/servicebus/custom.py index 7b21aeb5ff9..2b1bbd970e4 100644 --- a/src/azure-cli/azure/cli/command_modules/servicebus/custom.py +++ b/src/azure-cli/azure/cli/command_modules/servicebus/custom.py @@ -635,6 +635,7 @@ def return_valid_duration(update_value, current_value=None): from isodate import Duration from azure.cli.core.azclierror import InvalidArgumentValueError from azure.cli.command_modules.servicebus.constants import DURATION_SECS, DURATION_MIN, DURATION_DAYS + from argcomplete import warn if update_value is not None: value_toreturn = update_value else: @@ -658,6 +659,7 @@ def return_valid_duration(update_value, current_value=None): return value_toreturn if timedeltapattern.match(value_toreturn): + warn('Please use ISO8601 duration for timespan inputs. Timespan inputs of format (days:min:seconds) would be deprecated from version 2.45.0.') day, minute, seconds = value_toreturn.split(":") if timedelta(days=int(day), minutes=int(minute), seconds=int(seconds)) <= timedelta(days=DURATION_DAYS, minutes=DURATION_MIN, @@ -673,6 +675,7 @@ def return_valid_duration_create(update_value): from datetime import timedelta from isodate import parse_duration from knack.util import CLIError + import warnings from azure.cli.command_modules.servicebus.constants import DURATION_SECS, DURATION_MIN, DURATION_DAYS if update_value is not None: if iso8601pattern.match(update_value): @@ -681,6 +684,7 @@ def return_valid_duration_create(update_value): 'duration value should be less than (days:min:secs) 10675199:10085:477581') if timedeltapattern.match(update_value): + warnings.warn('Please use ISO8601 duration for timespan inputs. Timespan inputs of format (days:min:seconds) would be deprecated from version 2.45.0.') day, minute, seconds = update_value.split(":") if timedelta(days=int(day), minutes=int(minute), seconds=int(seconds)) <= timedelta(days=DURATION_DAYS, minutes=DURATION_MIN, seconds=DURATION_SECS): update_value = timedelta(days=int(day), minutes=int(minute), seconds=int(seconds))