Use --record instead of deprecated --records
The --records argument was deprecated during queens cycle[1], and
the new --record argument should be used.
[1] 66e4955408
Related-Bug: #1736161
Change-Id: Ia4d84e6167d1192fee351d663af3e9f4cda1ea3f
This commit is contained in:
parent
732cd520d4
commit
39423a98c5
@ -211,10 +211,13 @@ class RecordsetCommands:
|
||||
cmd = f'recordset list {zone_id}'
|
||||
return self.parsed_cmd(cmd, ListModel, *args, **kwargs)
|
||||
|
||||
def recordset_create(self, zone_id, name, records=None, type=None,
|
||||
def recordset_create(self, zone_id, name, record=None, type=None,
|
||||
description=None, ttl=None, *args, **kwargs):
|
||||
options_str = build_option_string({
|
||||
'--records': records,
|
||||
# NOTE(tkajinam): --record argument should be repeated when
|
||||
# multiple records are used. This code needs update when multiple
|
||||
# records are used in functional tests.
|
||||
'--record': record,
|
||||
'--type': type,
|
||||
'--description': description,
|
||||
'--ttl': ttl,
|
||||
@ -222,11 +225,14 @@ class RecordsetCommands:
|
||||
cmd = f'recordset create {zone_id} {name} {options_str}'
|
||||
return self.parsed_cmd(cmd, FieldValueModel, *args, **kwargs)
|
||||
|
||||
def recordset_set(self, zone_id, id, records=None, type=None,
|
||||
def recordset_set(self, zone_id, id, record=None, type=None,
|
||||
description=None, ttl=None, no_description=False,
|
||||
no_ttl=False, *args, **kwargs):
|
||||
options_str = build_option_string({
|
||||
'--records': records,
|
||||
# NOTE(tkajinam): --record argument should be repeated when
|
||||
# multiple records are used. This code needs update when multiple
|
||||
# records are used in functional tests.
|
||||
'--record': record,
|
||||
'--type': type,
|
||||
'--description': description,
|
||||
'--ttl': ttl,
|
||||
|
@ -36,7 +36,7 @@ class TestRecordset(BaseDesignateTest):
|
||||
self.recordset = self.useFixture(RecordsetFixture(
|
||||
zone_id=self.zone.id,
|
||||
name=name,
|
||||
records='1.2.3.4',
|
||||
record='1.2.3.4',
|
||||
description='An a recordset',
|
||||
type='A',
|
||||
ttl=1234,
|
||||
@ -77,7 +77,7 @@ class TestRecordset(BaseDesignateTest):
|
||||
rset = self.clients.recordset_set(
|
||||
self.zone.id,
|
||||
self.recordset.id,
|
||||
records='2.3.4.5',
|
||||
record='2.3.4.5',
|
||||
ttl=2345,
|
||||
description='Updated description',
|
||||
)
|
||||
@ -102,7 +102,7 @@ class TestRecordsetNegative(BaseDesignateTest):
|
||||
|
||||
def test_invalid_option_on_recordset_create(self):
|
||||
cmd = ('recordset create de47d30b-41c5-4e38-b2c5-e0b908e19ec7 '
|
||||
'aaa.desig.com. --type A --records 1.2.3.4 '
|
||||
'aaa.desig.com. --type A --record 1.2.3.4 '
|
||||
'--invalid "not valid"')
|
||||
self.assertRaises(CommandFailed, self.clients.openstack, cmd)
|
||||
|
||||
|
@ -76,7 +76,7 @@ the DNS standard, and we didn't set a TTL.
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ openstack recordset create --type A --records 192.0.2.20 example.com. www
|
||||
$ openstack recordset create --type A --record 192.0.2.20 example.com. www
|
||||
+-------------+--------------------------------------+
|
||||
| Field | Value |
|
||||
+-------------+--------------------------------------+
|
||||
@ -221,7 +221,7 @@ Using the zone above, create a recordset with the following command:
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ openstack recordset create example.com. --type A www --records 192.0.2.20
|
||||
$ openstack recordset create example.com. --type A www --record 192.0.2.20
|
||||
+-------------+--------------------------------------+
|
||||
| Field | Value |
|
||||
+-------------+--------------------------------------+
|
||||
@ -243,7 +243,7 @@ Multiple records can be provided for a specific recordset type:
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ openstack recordset create example.com. --type A www --records 192.0.2.20 192.0.2.21
|
||||
$ openstack recordset create example.com. --type A www --record 192.0.2.20 --record 192.0.2.21
|
||||
|
||||
See the new recordset in the list of recordsets with the following command:
|
||||
|
||||
@ -261,7 +261,7 @@ Update a specific recordset:
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ openstack recordset set example.com. www.example.com. --ttl 10000 --records 192.0.2.20 192.0.2.21
|
||||
$ openstack recordset set example.com. www.example.com. --ttl 10000 --record 192.0.2.20 --record 192.0.2.21
|
||||
|
||||
Delete a recordset:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user