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] 66e4955408

Related-Bug: #1736161
Change-Id: Ic49d9b350a890d435b525bae611c8ba22cd29339
This commit is contained in:
Takashi Kajinami 2023-12-27 02:08:52 +09:00
parent 39423a98c5
commit 4efec172d2
2 changed files with 11 additions and 23 deletions

View File

@ -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)

View File

@ -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``