From 9011aac4ccf5219453efbab38623b63a57282de0 Mon Sep 17 00:00:00 2001 From: "sonu.kumar" Date: Thu, 17 Mar 2016 11:49:19 +0900 Subject: [PATCH] Fixes 'openstack tld list' command's exception Earlier while executing "openstack tld list" command the designate client was not able to list the created tlds and was resulting an exception. This patch fixes those issues and makes designateclient to list all the created tlds. Change-Id: I762cf269eb8396b20915b98709f445acaa3f7649 Closes-Bug: #1557364 --- designateclient/v2/cli/tlds.py | 11 ++++++++++- designateclient/v2/tlds.py | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/designateclient/v2/cli/tlds.py b/designateclient/v2/cli/tlds.py index 57f62bf6..9f3dc77d 100644 --- a/designateclient/v2/cli/tlds.py +++ b/designateclient/v2/cli/tlds.py @@ -35,7 +35,16 @@ def _format_tld(tld): class ListTLDsCommand(lister.Lister): """List tlds""" - columns = ['id', 'name'] + columns = ['id', 'name', 'description'] + + def get_parser(self, prog_name): + parser = super(ListTLDsCommand, self).get_parser(prog_name) + + parser.add_argument('--name', help="TLD NAME") + + parser.add_argument('--description', help="TLD Description") + + return parser def take_action(self, parsed_args): client = self.app.client_manager.dns diff --git a/designateclient/v2/tlds.py b/designateclient/v2/tlds.py index 22591907..d70c88ab 100644 --- a/designateclient/v2/tlds.py +++ b/designateclient/v2/tlds.py @@ -13,11 +13,11 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -from designateclient import client +from designateclient.v2.base import V2Controller from designateclient.v2 import utils as v2_utils -class TLDController(client.Controller): +class TLDController(V2Controller): def create(self, name, description=None): data = { 'name': name,