summaryrefslogtreecommitdiff
path: root/designateclient
diff options
context:
space:
mode:
authorGraham Hayes <gr@ham.ie>2018-02-12 13:41:10 +0000
committerGraham Hayes <gr@ham.ie>2018-02-12 13:41:10 +0000
commit653643b448f10bec6d6c6d899831318f6bdbcf82 (patch)
tree77baac9499fc0f05da4221cdcc99f7f2e534c749 /designateclient
parent1a3632cf5748db837b6d85b1f8d40eeae0a270c6 (diff)
downloadpython-designateclient-653643b448f10bec6d6c6d899831318f6bdbcf82.tar.gz
Improve the RecordSet Update UI
This adds the logic introduced in I8fefd9d0f104170d50c5d5dc3cbcc53facda9baf to the "recordset set" command as well. This helps with the consistancy, and fixes some of the same issues in the set command. Change-Id: Ib943ed0eea436ad1a7ad0c3717f0fb6bd6b5b3f0
Diffstat (limited to 'designateclient')
-rw-r--r--designateclient/v2/cli/recordsets.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/designateclient/v2/cli/recordsets.py b/designateclient/v2/cli/recordsets.py
index 898da19..e4ea9aa 100644
--- a/designateclient/v2/cli/recordsets.py
+++ b/designateclient/v2/cli/recordsets.py
@@ -193,7 +193,15 @@ class SetRecordSetCommand(command.ShowOne):
parser.add_argument('zone_id', help="Zone ID")
parser.add_argument('id', help="RecordSet ID")
- parser.add_argument('--records', help="Records", nargs='+')
+ 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",
+ action='append')
description_group = parser.add_mutually_exclusive_group()
description_group.add_argument('--description', help="Description")
@@ -220,8 +228,13 @@ 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:
- data['records'] = parsed_args.records
+ self.log.warning(
+ "Option --records is deprecated, use --record instead.")
+
+ if all_records:
+ data['records'] = all_records
client = self.app.client_manager.dns
common.set_all_common_headers(client, parsed_args)