Merge "[OSC] Fix output format for osc share subnet create"
This commit is contained in:
commit
5907822db6
@ -21,6 +21,7 @@ from osc_lib import utils as oscutils
|
||||
|
||||
from manilaclient import api_versions
|
||||
from manilaclient.common._i18n import _
|
||||
from manilaclient.common import cliutils
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
@ -135,6 +136,15 @@ class CreateShareNetworkSubnet(command.ShowOne):
|
||||
share_network_id=share_network_id)
|
||||
)
|
||||
subnet_data = subnet_create_check[1]
|
||||
if subnet_data:
|
||||
if parsed_args.formatter == 'table':
|
||||
for k, v in subnet_data.items():
|
||||
if isinstance(v, dict):
|
||||
capabilities_list = [v]
|
||||
dict_values = cliutils.convert_dict_list_to_string(
|
||||
capabilities_list
|
||||
)
|
||||
subnet_data[k] = dict_values
|
||||
else:
|
||||
share_network_subnet = share_client.share_network_subnets.create(
|
||||
neutron_net_id=parsed_args.neutron_net_id,
|
||||
|
@ -25,7 +25,7 @@ class ShareNetworkSubnetsCLITest(base.OSCClientTestBase):
|
||||
share_network['id'])
|
||||
|
||||
self.assertEqual('True', check_result['compatible'])
|
||||
self.assertEqual('{}', check_result['hosts_check_result'])
|
||||
self.assertEqual('', check_result['hosts_check_result'])
|
||||
|
||||
def test_openstack_share_network_create_check_restart(self):
|
||||
share_network = self.create_share_network()
|
||||
@ -34,4 +34,4 @@ class ShareNetworkSubnetsCLITest(base.OSCClientTestBase):
|
||||
share_network['id'], restart_check=True)
|
||||
|
||||
self.assertEqual('True', check_result['compatible'])
|
||||
self.assertEqual('{}', check_result['hosts_check_result'])
|
||||
self.assertEqual('', check_result['hosts_check_result'])
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
The format of the osc share network subnet create command output has been
|
||||
updated to return a list of hosts instead of a dictionary, as we do for
|
||||
other commands in the client.
|
Loading…
Reference in New Issue
Block a user