From 4efec172d2ced30e51641d0161842986b2923440 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 27 Dec 2023 02:08:52 +0900 Subject: [PATCH] Recordset: Remove deprecated --records argument The --records argument was deprecated in 2.8.0[1], which was released during queens cycle. Multiple cycles have passed since then so we can remove these deprecated options now. [1] 66e4955408eacb4859cfef01a31d013e34c28ffb Related-Bug: #1736161 Change-Id: Ic49d9b350a890d435b525bae611c8ba22cd29339 --- designateclient/v2/cli/recordsets.py | 26 +++---------------- ...ove-records-argument-8eda058e3bf028ca.yaml | 8 ++++++ 2 files changed, 11 insertions(+), 23 deletions(-) create mode 100644 releasenotes/notes/remove-records-argument-8eda058e3bf028ca.yaml diff --git a/designateclient/v2/cli/recordsets.py b/designateclient/v2/cli/recordsets.py index 10caba68..e571aa17 100644 --- a/designateclient/v2/cli/recordsets.py +++ b/designateclient/v2/cli/recordsets.py @@ -14,7 +14,6 @@ # License for the specific language governing permissions and limitations # under the License. -import argparse import logging from osc_lib.command import command @@ -140,18 +139,12 @@ class ShowRecordSetCommand(command.ShowOne): class CreateRecordSetCommand(command.ShowOne): """Create new recordset""" - log = logging.getLogger('deprecated') - def get_parser(self, prog_name): parser = super().get_parser(prog_name) parser.add_argument('zone_id', help='Zone ID') parser.add_argument('name', help='RecordSet Name') req_group = parser.add_mutually_exclusive_group(required=True) - req_group.add_argument( - '--records', - help=argparse.SUPPRESS, - nargs='+') req_group.add_argument( '--record', help='RecordSet Record, repeat if necessary', @@ -168,15 +161,11 @@ class CreateRecordSetCommand(command.ShowOne): client = self.app.client_manager.dns common.set_all_common_headers(client, parsed_args) - all_records = parsed_args.record or parsed_args.records - if parsed_args.records: - self.log.warning( - 'Option --records is deprecated, use --record instead.') data = client.recordsets.create( parsed_args.zone_id, parsed_args.name, parsed_args.type, - all_records, + parsed_args.record, description=parsed_args.description, ttl=parsed_args.ttl) @@ -193,10 +182,6 @@ class SetRecordSetCommand(command.ShowOne): parser.add_argument('zone_id', help='Zone ID') parser.add_argument('id', help='RecordSet ID') req_group = parser.add_mutually_exclusive_group() - req_group.add_argument( - '--records', - help=argparse.SUPPRESS, - nargs='+') req_group.add_argument( '--record', help='RecordSet Record, repeat if necessary', @@ -228,13 +213,8 @@ class SetRecordSetCommand(command.ShowOne): elif parsed_args.ttl: data['ttl'] = parsed_args.ttl - all_records = parsed_args.record or parsed_args.records - if parsed_args.records: - self.log.warning( - 'Option --records is deprecated, use --record instead.') - - if all_records: - data['records'] = all_records + if parsed_args.record: + data['records'] = parsed_args.record client = self.app.client_manager.dns common.set_all_common_headers(client, parsed_args) diff --git a/releasenotes/notes/remove-records-argument-8eda058e3bf028ca.yaml b/releasenotes/notes/remove-records-argument-8eda058e3bf028ca.yaml new file mode 100644 index 00000000..a5c4eb41 --- /dev/null +++ b/releasenotes/notes/remove-records-argument-8eda058e3bf028ca.yaml @@ -0,0 +1,8 @@ +--- +upgrade: + - | + The following commands no longer support the ``--records`` argument. Use + the ``--record`` argument instead. + + - ``openstack recordset create`` + - ``openstack recordset set``