From 35dc85823d9e390e70bf8fcd4eea6c77e51359c5 Mon Sep 17 00:00:00 2001 From: Huanxuan Ao Date: Thu, 9 Mar 2017 19:28:51 +0800 Subject: [PATCH] Revert "Fix port command for SDK >0.9.10" This reverts commit 8e277c64fb86dc1ca432e02b82accdcaf42a2779. After [1] merged in osc-lib, we can Avoid 'NoneType' error when format conversion now, So [2] in no longer needed, we can clean it up. Hold this until [1] released and included in the requirement in OSC. [1] https://review.openstack.org/#/c/434768/ [2] https://review.openstack.org/#/c/420420/ Depend-On: I649b4fc65ef7c19b8193b07f3bd59f00e6095f9f Change-Id: I2783713102d5e6164d9617f130c2f595bd6d939e --- openstackclient/network/v2/port.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py index 6117175e9e..ec7042914d 100644 --- a/openstackclient/network/v2/port.py +++ b/openstackclient/network/v2/port.py @@ -35,10 +35,6 @@ def _format_admin_state(state): return 'UP' if state else 'DOWN' -def _format_dns_assignment(dns_assignment): - return utils.format_list_of_dicts(dns_assignment) \ - if dns_assignment else None - _formatters = { 'admin_state_up': _format_admin_state, 'is_admin_state_up': _format_admin_state, @@ -47,7 +43,7 @@ _formatters = { 'binding_vif_details': utils.format_dict, 'binding:profile': utils.format_dict, 'binding:vif_details': utils.format_dict, - 'dns_assignment': _format_dns_assignment, + 'dns_assignment': utils.format_list_of_dicts, 'extra_dhcp_opts': utils.format_list_of_dicts, 'fixed_ips': utils.format_list_of_dicts, 'security_group_ids': utils.format_list,