Revert "Format location columns in network commands"
This reverts commit 6ee7b8d138
.
Change-Id: I5f59959ba8a01aba49e29f4cb007397467344e58
This commit is contained in:
parent
3e6874dc87
commit
a04172969a
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
@ -28,11 +27,6 @@ from openstackclient.network import sdk_utils
|
|||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
_formatters = {
|
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _get_columns(item):
|
def _get_columns(item):
|
||||||
column_map = {
|
column_map = {
|
||||||
'is_shared': 'shared',
|
'is_shared': 'shared',
|
||||||
@ -106,7 +100,7 @@ class CreateAddressScope(command.ShowOne):
|
|||||||
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
||||||
obj = client.create_address_scope(**attrs)
|
obj = client.create_address_scope(**attrs)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns, formatters={})
|
||||||
|
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
|
||||||
@ -295,6 +289,6 @@ class ShowAddressScope(command.ShowOne):
|
|||||||
parsed_args.address_scope,
|
parsed_args.address_scope,
|
||||||
ignore_missing=False)
|
ignore_missing=False)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns, formatters={})
|
||||||
|
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
"""IP Floating action implementations"""
|
"""IP Floating action implementations"""
|
||||||
|
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
from osc_lib.utils import tags as _tag
|
from osc_lib.utils import tags as _tag
|
||||||
@ -25,7 +24,6 @@ from openstackclient.network import sdk_utils
|
|||||||
|
|
||||||
|
|
||||||
_formatters = {
|
_formatters = {
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
'port_details': utils.format_dict,
|
'port_details': utils.format_dict,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,9 +21,7 @@ from openstackclient.i18n import _
|
|||||||
from openstackclient.identity import common as identity_common
|
from openstackclient.identity import common as identity_common
|
||||||
from openstackclient.network import sdk_utils
|
from openstackclient.network import sdk_utils
|
||||||
|
|
||||||
|
|
||||||
_formatters = {
|
_formatters = {
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
'subnet_ip_availability': format_columns.ListDictColumn,
|
'subnet_ip_availability': format_columns.ListDictColumn,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ _formatters = {
|
|||||||
'subnet_ids': format_columns.ListColumn,
|
'subnet_ids': format_columns.ListColumn,
|
||||||
'admin_state_up': AdminStateColumn,
|
'admin_state_up': AdminStateColumn,
|
||||||
'is_admin_state_up': AdminStateColumn,
|
'is_admin_state_up': AdminStateColumn,
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
'router:external': RouterExternalColumn,
|
'router:external': RouterExternalColumn,
|
||||||
'is_router_external': RouterExternalColumn,
|
'is_router_external': RouterExternalColumn,
|
||||||
'availability_zones': format_columns.ListColumn,
|
'availability_zones': format_columns.ListColumn,
|
||||||
|
@ -43,7 +43,6 @@ _formatters = {
|
|||||||
'alive': AliveColumn,
|
'alive': AliveColumn,
|
||||||
'admin_state_up': AdminStateColumn,
|
'admin_state_up': AdminStateColumn,
|
||||||
'is_admin_state_up': AdminStateColumn,
|
'is_admin_state_up': AdminStateColumn,
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
'configurations': format_columns.DictColumn,
|
'configurations': format_columns.DictColumn,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
@ -26,11 +25,6 @@ from openstackclient.network import sdk_utils
|
|||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
_formatters = {
|
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _get_columns(item):
|
def _get_columns(item):
|
||||||
column_map = {
|
column_map = {
|
||||||
'tenant_id': 'project_id',
|
'tenant_id': 'project_id',
|
||||||
@ -99,17 +93,16 @@ class CreateAutoAllocatedTopology(command.ShowOne):
|
|||||||
obj = client.validate_auto_allocated_topology(parsed_args.project)
|
obj = client.validate_auto_allocated_topology(parsed_args.project)
|
||||||
|
|
||||||
columns = _format_check_resource_columns()
|
columns = _format_check_resource_columns()
|
||||||
data = utils.get_item_properties(
|
data = utils.get_item_properties(_format_check_resource(obj),
|
||||||
_format_check_resource(obj),
|
columns,
|
||||||
columns,
|
formatters={})
|
||||||
formatters=_formatters,
|
|
||||||
)
|
|
||||||
return (columns, data)
|
return (columns, data)
|
||||||
|
|
||||||
def get_topology(self, client, parsed_args):
|
def get_topology(self, client, parsed_args):
|
||||||
obj = client.get_auto_allocated_topology(parsed_args.project)
|
obj = client.get_auto_allocated_topology(parsed_args.project)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns, formatters={})
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
@ -28,11 +27,6 @@ from openstackclient.network import sdk_utils
|
|||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
_formatters = {
|
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _get_columns(item):
|
def _get_columns(item):
|
||||||
column_map = {
|
column_map = {
|
||||||
'is_enabled': 'enabled',
|
'is_enabled': 'enabled',
|
||||||
@ -142,7 +136,7 @@ class CreateNetworkFlavor(command.ShowOne):
|
|||||||
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
||||||
obj = client.create_flavor(**attrs)
|
obj = client.create_flavor(**attrs)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns, formatters={})
|
||||||
|
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
|
||||||
@ -306,5 +300,5 @@ class ShowNetworkFlavor(command.ShowOne):
|
|||||||
client = self.app.client_manager.network
|
client = self.app.client_manager.network
|
||||||
obj = client.find_flavor(parsed_args.flavor, ignore_missing=False)
|
obj = client.find_flavor(parsed_args.flavor, ignore_missing=False)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
return display_columns, data
|
return display_columns, data
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
@ -26,11 +25,6 @@ from openstackclient.network import sdk_utils
|
|||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
_formatters = {
|
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _get_columns(item):
|
def _get_columns(item):
|
||||||
column_map = {
|
column_map = {
|
||||||
'is_enabled': 'enabled',
|
'is_enabled': 'enabled',
|
||||||
@ -116,7 +110,7 @@ class CreateNetworkFlavorProfile(command.ShowOne):
|
|||||||
|
|
||||||
obj = client.create_service_profile(**attrs)
|
obj = client.create_service_profile(**attrs)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns, formatters={})
|
||||||
|
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
|
||||||
@ -252,5 +246,5 @@ class ShowNetworkFlavorProfile(command.ShowOne):
|
|||||||
obj = client.find_service_profile(parsed_args.flavor_profile,
|
obj = client.find_service_profile(parsed_args.flavor_profile,
|
||||||
ignore_missing=False)
|
ignore_missing=False)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
@ -27,11 +26,6 @@ from openstackclient.network import sdk_utils
|
|||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
_formatters = {
|
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _get_columns(item):
|
def _get_columns(item):
|
||||||
column_map = {
|
column_map = {
|
||||||
'is_shared': 'shared',
|
'is_shared': 'shared',
|
||||||
@ -108,7 +102,7 @@ class CreateMeter(command.ShowOne):
|
|||||||
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
||||||
obj = client.create_metering_label(**attrs)
|
obj = client.create_metering_label(**attrs)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns, formatters={})
|
||||||
|
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
|
||||||
@ -192,5 +186,5 @@ class ShowMeter(command.ShowOne):
|
|||||||
obj = client.find_metering_label(parsed_args.meter,
|
obj = client.find_metering_label(parsed_args.meter,
|
||||||
ignore_missing=False)
|
ignore_missing=False)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
return display_columns, data
|
return display_columns, data
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
@ -27,11 +26,6 @@ from openstackclient.network import sdk_utils
|
|||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
_formatters = {
|
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _get_columns(item):
|
def _get_columns(item):
|
||||||
column_map = {
|
column_map = {
|
||||||
'tenant_id': 'project_id',
|
'tenant_id': 'project_id',
|
||||||
@ -122,7 +116,7 @@ class CreateMeterRule(command.ShowOne):
|
|||||||
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
||||||
obj = client.create_metering_label_rule(**attrs)
|
obj = client.create_metering_label_rule(**attrs)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns, formatters={})
|
||||||
|
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
|
||||||
@ -205,5 +199,5 @@ class ShowMeterRule(command.ShowOne):
|
|||||||
obj = client.find_metering_label_rule(parsed_args.meter_rule_id,
|
obj = client.find_metering_label_rule(parsed_args.meter_rule_id,
|
||||||
ignore_missing=False)
|
ignore_missing=False)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
return display_columns, data
|
return display_columns, data
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
@ -28,11 +27,6 @@ from openstackclient.network import sdk_utils
|
|||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
_formatters = {
|
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _get_columns(item):
|
def _get_columns(item):
|
||||||
column_map = {
|
column_map = {
|
||||||
'is_shared': 'shared',
|
'is_shared': 'shared',
|
||||||
@ -125,7 +119,7 @@ class CreateNetworkQosPolicy(command.ShowOne):
|
|||||||
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
||||||
obj = client.create_qos_policy(**attrs)
|
obj = client.create_qos_policy(**attrs)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns, formatters={})
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
|
||||||
|
|
||||||
@ -285,5 +279,5 @@ class ShowNetworkQosPolicy(command.ShowOne):
|
|||||||
obj = client.find_qos_policy(parsed_args.policy,
|
obj = client.find_qos_policy(parsed_args.policy,
|
||||||
ignore_missing=False)
|
ignore_missing=False)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
@ -47,11 +46,6 @@ ACTION_SET = 'update'
|
|||||||
ACTION_SHOW = 'get'
|
ACTION_SHOW = 'get'
|
||||||
|
|
||||||
|
|
||||||
_formatters = {
|
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _get_columns(item):
|
def _get_columns(item):
|
||||||
column_map = {
|
column_map = {
|
||||||
'tenant_id': 'project_id',
|
'tenant_id': 'project_id',
|
||||||
@ -214,7 +208,7 @@ class CreateNetworkQosRule(command.ShowOne):
|
|||||||
msg = (_('Failed to create Network QoS rule: %(e)s') % {'e': e})
|
msg = (_('Failed to create Network QoS rule: %(e)s') % {'e': e})
|
||||||
raise exceptions.CommandError(msg)
|
raise exceptions.CommandError(msg)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
return display_columns, data
|
return display_columns, data
|
||||||
|
|
||||||
|
|
||||||
@ -364,5 +358,5 @@ class ShowNetworkQosRule(command.ShowOne):
|
|||||||
{'rule': rule_id, 'e': e})
|
{'rule': rule_id, 'e': e})
|
||||||
raise exceptions.CommandError(msg)
|
raise exceptions.CommandError(msg)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
return display_columns, data
|
return display_columns, data
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
@ -21,11 +20,6 @@ from openstackclient.i18n import _
|
|||||||
from openstackclient.network import sdk_utils
|
from openstackclient.network import sdk_utils
|
||||||
|
|
||||||
|
|
||||||
_formatters = {
|
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _get_columns(item):
|
def _get_columns(item):
|
||||||
column_map = {
|
column_map = {
|
||||||
"type": "rule_type_name",
|
"type": "rule_type_name",
|
||||||
@ -71,5 +65,5 @@ class ShowNetworkQosRuleType(command.ShowOne):
|
|||||||
client = self.app.client_manager.network
|
client = self.app.client_manager.network
|
||||||
obj = client.get_qos_rule_type(parsed_args.rule_type)
|
obj = client.get_qos_rule_type(parsed_args.rule_type)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
return display_columns, data
|
return display_columns, data
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
@ -28,11 +27,6 @@ from openstackclient.network import sdk_utils
|
|||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
_formatters = {
|
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _get_columns(item):
|
def _get_columns(item):
|
||||||
column_map = {
|
column_map = {
|
||||||
'target_tenant': 'target_project_id',
|
'target_tenant': 'target_project_id',
|
||||||
@ -153,7 +147,7 @@ class CreateNetworkRBAC(command.ShowOne):
|
|||||||
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
||||||
obj = client.create_rbac_policy(**attrs)
|
obj = client.create_rbac_policy(**attrs)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
return display_columns, data
|
return display_columns, data
|
||||||
|
|
||||||
|
|
||||||
@ -311,5 +305,5 @@ class ShowNetworkRBAC(command.ShowOne):
|
|||||||
obj = client.find_rbac_policy(parsed_args.rbac_policy,
|
obj = client.find_rbac_policy(parsed_args.rbac_policy,
|
||||||
ignore_missing=False)
|
ignore_missing=False)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
return display_columns, data
|
return display_columns, data
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
@ -27,11 +26,6 @@ from openstackclient.network import sdk_utils
|
|||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
_formatters = {
|
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _get_columns(item):
|
def _get_columns(item):
|
||||||
return sdk_utils.get_osc_show_columns_for_sdk_resource(item, {})
|
return sdk_utils.get_osc_show_columns_for_sdk_resource(item, {})
|
||||||
|
|
||||||
@ -96,7 +90,7 @@ class CreateNetworkSegment(command.ShowOne):
|
|||||||
attrs['segmentation_id'] = parsed_args.segment
|
attrs['segmentation_id'] = parsed_args.segment
|
||||||
obj = client.create_segment(**attrs)
|
obj = client.create_segment(**attrs)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
|
||||||
|
|
||||||
@ -248,5 +242,5 @@ class ShowNetworkSegment(command.ShowOne):
|
|||||||
ignore_missing=False
|
ignore_missing=False
|
||||||
)
|
)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
import itertools
|
import itertools
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
@ -31,10 +30,6 @@ from openstackclient.network import sdk_utils
|
|||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
_formatters = {
|
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _get_columns(item):
|
def _get_columns(item):
|
||||||
return sdk_utils.get_osc_show_columns_for_sdk_resource(item, {})
|
return sdk_utils.get_osc_show_columns_for_sdk_resource(item, {})
|
||||||
@ -216,7 +211,7 @@ class CreateNetworkSegmentRange(command.ShowOne):
|
|||||||
attrs['physical_network'] = parsed_args.physical_network
|
attrs['physical_network'] = parsed_args.physical_network
|
||||||
obj = network_client.create_network_segment_range(**attrs)
|
obj = network_client.create_network_segment_range(**attrs)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
data = _update_additional_fields_from_props(columns, props=data)
|
data = _update_additional_fields_from_props(columns, props=data)
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
|
||||||
@ -455,6 +450,6 @@ class ShowNetworkSegmentRange(command.ShowOne):
|
|||||||
ignore_missing=False
|
ignore_missing=False
|
||||||
)
|
)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
data = _update_additional_fields_from_props(columns, props=data)
|
data = _update_additional_fields_from_props(columns, props=data)
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
@ -51,7 +51,6 @@ _formatters = {
|
|||||||
'dns_assignment': format_columns.ListDictColumn,
|
'dns_assignment': format_columns.ListDictColumn,
|
||||||
'extra_dhcp_opts': format_columns.ListDictColumn,
|
'extra_dhcp_opts': format_columns.ListDictColumn,
|
||||||
'fixed_ips': format_columns.ListDictColumn,
|
'fixed_ips': format_columns.ListDictColumn,
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
'security_group_ids': format_columns.ListColumn,
|
'security_group_ids': format_columns.ListColumn,
|
||||||
'tags': format_columns.ListColumn,
|
'tags': format_columns.ListColumn,
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,6 @@ _formatters = {
|
|||||||
'external_gateway_info': RouterInfoColumn,
|
'external_gateway_info': RouterInfoColumn,
|
||||||
'availability_zones': format_columns.ListColumn,
|
'availability_zones': format_columns.ListColumn,
|
||||||
'availability_zone_hints': format_columns.ListColumn,
|
'availability_zone_hints': format_columns.ListColumn,
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
'routes': RoutesColumn,
|
'routes': RoutesColumn,
|
||||||
'tags': format_columns.ListColumn,
|
'tags': format_columns.ListColumn,
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
from cliff import columns as cliff_columns
|
from cliff import columns as cliff_columns
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
from osc_lib.utils import tags as _tag
|
from osc_lib.utils import tags as _tag
|
||||||
@ -77,13 +76,11 @@ class ComputeSecurityGroupRulesColumn(cliff_columns.FormattableColumn):
|
|||||||
|
|
||||||
|
|
||||||
_formatters_network = {
|
_formatters_network = {
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
'security_group_rules': NetworkSecurityGroupRulesColumn,
|
'security_group_rules': NetworkSecurityGroupRulesColumn,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_formatters_compute = {
|
_formatters_compute = {
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
'rules': ComputeSecurityGroupRulesColumn,
|
'rules': ComputeSecurityGroupRulesColumn,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from osc_lib.cli import format_columns
|
|
||||||
from osc_lib.cli import parseractions
|
from osc_lib.cli import parseractions
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
@ -31,11 +30,6 @@ from openstackclient.network import utils as network_utils
|
|||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
_formatters = {
|
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _format_security_group_rule_show(obj):
|
def _format_security_group_rule_show(obj):
|
||||||
data = network_utils.transform_compute_security_group_rule(obj)
|
data = network_utils.transform_compute_security_group_rule(obj)
|
||||||
return zip(*sorted(data.items()))
|
return zip(*sorted(data.items()))
|
||||||
@ -353,7 +347,7 @@ class CreateSecurityGroupRule(common.NetworkAndComputeShowOne):
|
|||||||
# Create and show the security group rule.
|
# Create and show the security group rule.
|
||||||
obj = client.create_security_group_rule(**attrs)
|
obj = client.create_security_group_rule(**attrs)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
|
||||||
def take_action_compute(self, client, parsed_args):
|
def take_action_compute(self, client, parsed_args):
|
||||||
@ -620,7 +614,7 @@ class ShowSecurityGroupRule(common.NetworkAndComputeShowOne):
|
|||||||
if not obj['remote_ip_prefix']:
|
if not obj['remote_ip_prefix']:
|
||||||
obj['remote_ip_prefix'] = _format_remote_ip_prefix(obj)
|
obj['remote_ip_prefix'] = _format_remote_ip_prefix(obj)
|
||||||
display_columns, columns = _get_columns(obj)
|
display_columns, columns = _get_columns(obj)
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
data = utils.get_item_properties(obj, columns)
|
||||||
return (display_columns, data)
|
return (display_columns, data)
|
||||||
|
|
||||||
def take_action_compute(self, client, parsed_args):
|
def take_action_compute(self, client, parsed_args):
|
||||||
|
@ -61,7 +61,6 @@ _formatters = {
|
|||||||
'allocation_pools': AllocationPoolsColumn,
|
'allocation_pools': AllocationPoolsColumn,
|
||||||
'dns_nameservers': format_columns.ListColumn,
|
'dns_nameservers': format_columns.ListColumn,
|
||||||
'host_routes': HostRoutesColumn,
|
'host_routes': HostRoutesColumn,
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
'service_types': format_columns.ListColumn,
|
'service_types': format_columns.ListColumn,
|
||||||
'tags': format_columns.ListColumn,
|
'tags': format_columns.ListColumn,
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,6 @@ def _get_columns(item):
|
|||||||
|
|
||||||
|
|
||||||
_formatters = {
|
_formatters = {
|
||||||
'location': format_columns.DictColumn,
|
|
||||||
'prefixes': format_columns.ListColumn,
|
'prefixes': format_columns.ListColumn,
|
||||||
'tags': format_columns.ListColumn,
|
'tags': format_columns.ListColumn,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user