From be1b1fda8a9f5060653fe4d30e28993a60dfefc6 Mon Sep 17 00:00:00 2001 From: Michael Chapman Date: Fri, 14 May 2021 13:47:05 +1000 Subject: [PATCH] Remove edit-managed from unsupported commands --edit-managed sets a header x-designate-edit-managed-records that indicates the current request wishes to modify managed records such as the SOA or NS record created for a zone. This is only used by the recordset update and delete API methods so can be removed elsewhere. Closes-Bug: 1928411 Change-Id: I18bfdae045c8b5e589075865eb024cee4852d8f9 (cherry picked from commit 94e7e97e50b0622cb27a20c3aead22e6e25ac5ad) --- designateclient/v2/cli/common.py | 4 ++-- designateclient/v2/cli/recordsets.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/designateclient/v2/cli/common.py b/designateclient/v2/cli/common.py index ca667541..59dd0084 100644 --- a/designateclient/v2/cli/common.py +++ b/designateclient/v2/cli/common.py @@ -43,7 +43,6 @@ def add_sudo_project_id_option(parser): def add_all_common_options(parser): add_all_projects_option(parser) - add_edit_managed_option(parser) add_sudo_project_id_option(parser) @@ -65,7 +64,8 @@ def set_all_common_headers(client, parsed_args): isinstance(parsed_args.all_projects, bool): set_all_projects(client, parsed_args.all_projects) - if parsed_args.edit_managed is not None and \ + if hasattr(parsed_args, 'edit_managed') and \ + parsed_args.edit_managed is not None and \ isinstance(parsed_args.edit_managed, bool): set_edit_managed(client, parsed_args.edit_managed) diff --git a/designateclient/v2/cli/recordsets.py b/designateclient/v2/cli/recordsets.py index f764454e..d79dfb8f 100644 --- a/designateclient/v2/cli/recordsets.py +++ b/designateclient/v2/cli/recordsets.py @@ -211,6 +211,7 @@ class SetRecordSetCommand(command.ShowOne): ttl_group.add_argument('--no-ttl', action='store_true') common.add_all_common_options(parser) + common.add_edit_managed_option(parser) return parser @@ -258,6 +259,7 @@ class DeleteRecordSetCommand(command.ShowOne): parser.add_argument('id', help="RecordSet ID") common.add_all_common_options(parser) + common.add_edit_managed_option(parser) return parser