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
This commit is contained in:
parent
39423a98c5
commit
4efec172d2
@ -14,7 +14,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import argparse
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
@ -140,18 +139,12 @@ class ShowRecordSetCommand(command.ShowOne):
|
|||||||
class CreateRecordSetCommand(command.ShowOne):
|
class CreateRecordSetCommand(command.ShowOne):
|
||||||
"""Create new recordset"""
|
"""Create new recordset"""
|
||||||
|
|
||||||
log = logging.getLogger('deprecated')
|
|
||||||
|
|
||||||
def get_parser(self, prog_name):
|
def get_parser(self, prog_name):
|
||||||
parser = super().get_parser(prog_name)
|
parser = super().get_parser(prog_name)
|
||||||
|
|
||||||
parser.add_argument('zone_id', help='Zone ID')
|
parser.add_argument('zone_id', help='Zone ID')
|
||||||
parser.add_argument('name', help='RecordSet Name')
|
parser.add_argument('name', help='RecordSet Name')
|
||||||
req_group = parser.add_mutually_exclusive_group(required=True)
|
req_group = parser.add_mutually_exclusive_group(required=True)
|
||||||
req_group.add_argument(
|
|
||||||
'--records',
|
|
||||||
help=argparse.SUPPRESS,
|
|
||||||
nargs='+')
|
|
||||||
req_group.add_argument(
|
req_group.add_argument(
|
||||||
'--record',
|
'--record',
|
||||||
help='RecordSet Record, repeat if necessary',
|
help='RecordSet Record, repeat if necessary',
|
||||||
@ -168,15 +161,11 @@ class CreateRecordSetCommand(command.ShowOne):
|
|||||||
client = self.app.client_manager.dns
|
client = self.app.client_manager.dns
|
||||||
common.set_all_common_headers(client, parsed_args)
|
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(
|
data = client.recordsets.create(
|
||||||
parsed_args.zone_id,
|
parsed_args.zone_id,
|
||||||
parsed_args.name,
|
parsed_args.name,
|
||||||
parsed_args.type,
|
parsed_args.type,
|
||||||
all_records,
|
parsed_args.record,
|
||||||
description=parsed_args.description,
|
description=parsed_args.description,
|
||||||
ttl=parsed_args.ttl)
|
ttl=parsed_args.ttl)
|
||||||
|
|
||||||
@ -193,10 +182,6 @@ class SetRecordSetCommand(command.ShowOne):
|
|||||||
parser.add_argument('zone_id', help='Zone ID')
|
parser.add_argument('zone_id', help='Zone ID')
|
||||||
parser.add_argument('id', help='RecordSet ID')
|
parser.add_argument('id', help='RecordSet ID')
|
||||||
req_group = parser.add_mutually_exclusive_group()
|
req_group = parser.add_mutually_exclusive_group()
|
||||||
req_group.add_argument(
|
|
||||||
'--records',
|
|
||||||
help=argparse.SUPPRESS,
|
|
||||||
nargs='+')
|
|
||||||
req_group.add_argument(
|
req_group.add_argument(
|
||||||
'--record',
|
'--record',
|
||||||
help='RecordSet Record, repeat if necessary',
|
help='RecordSet Record, repeat if necessary',
|
||||||
@ -228,13 +213,8 @@ class SetRecordSetCommand(command.ShowOne):
|
|||||||
elif parsed_args.ttl:
|
elif parsed_args.ttl:
|
||||||
data['ttl'] = parsed_args.ttl
|
data['ttl'] = parsed_args.ttl
|
||||||
|
|
||||||
all_records = parsed_args.record or parsed_args.records
|
if parsed_args.record:
|
||||||
if parsed_args.records:
|
data['records'] = parsed_args.record
|
||||||
self.log.warning(
|
|
||||||
'Option --records is deprecated, use --record instead.')
|
|
||||||
|
|
||||||
if all_records:
|
|
||||||
data['records'] = all_records
|
|
||||||
|
|
||||||
client = self.app.client_manager.dns
|
client = self.app.client_manager.dns
|
||||||
common.set_all_common_headers(client, parsed_args)
|
common.set_all_common_headers(client, parsed_args)
|
||||||
|
@ -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``
|
Loading…
x
Reference in New Issue
Block a user