diff options
author | Zuul <zuul@review.openstack.org> | 2018-02-12 20:45:02 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2018-02-12 20:45:02 +0000 |
commit | 95367aa57f4db20dda366687ae2249a1448a8b20 (patch) | |
tree | e7843c48c0445034bfa97d0dbfcd30d228202f0f | |
parent | 77c743f8b96859475f29803d0cbb5467111cf846 (diff) | |
parent | 653643b448f10bec6d6c6d899831318f6bdbcf82 (diff) | |
download | python-designateclient-95367aa57f4db20dda366687ae2249a1448a8b20.tar.gz |
Merge "Improve the RecordSet Update UI"
-rw-r--r-- | designateclient/v2/cli/recordsets.py | 17 |
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) |