Display driver field while listing datasources
This commit displays driver field while listing datasources and hides the type field as it is None always Change-Id: I9b8550f3fb97fecee14f74a6447d908550cfdfc4
This commit is contained in:
@@ -36,7 +36,8 @@ class ListDatasources(lister.Lister):
|
||||
def take_action(self, parsed_args):
|
||||
client = self.app.client_manager.congressclient
|
||||
data = client.list_datasources()['results']
|
||||
columns = ['id', 'name', 'enabled', 'type', 'config']
|
||||
# Type is always None, so disabling it for now.
|
||||
columns = ['id', 'name', 'enabled', 'driver', 'config']
|
||||
formatters = {'config': utils.format_dict}
|
||||
return (columns,
|
||||
(utils.get_dict_properties(s, columns,
|
||||
|
||||
@@ -29,7 +29,7 @@ class TestListDatasources(common.TestCongressBase):
|
||||
"results": [{"id": datasource_name,
|
||||
"name": "my_name",
|
||||
"enabled": "True",
|
||||
"type": "None",
|
||||
"driver": "driver1",
|
||||
"config": "None"}]
|
||||
}
|
||||
lister = mock.Mock(return_value=response)
|
||||
@@ -40,7 +40,7 @@ class TestListDatasources(common.TestCongressBase):
|
||||
result = cmd.take_action(parsed_args)
|
||||
|
||||
lister.assert_called_with()
|
||||
self.assertEqual(['id', 'name', 'enabled', 'type', 'config'],
|
||||
self.assertEqual(['id', 'name', 'enabled', 'driver', 'config'],
|
||||
result[0])
|
||||
|
||||
def test_list_datasource_output_not_unicode(self):
|
||||
@@ -50,7 +50,7 @@ class TestListDatasources(common.TestCongressBase):
|
||||
u"results": [{u"id": u"neutron",
|
||||
u"name": u"my_name",
|
||||
u"enabled": True,
|
||||
u"type": None,
|
||||
u"driver": 'driver1',
|
||||
u"config": {
|
||||
u'username': u'admin',
|
||||
u'tenant_name': u'admin',
|
||||
@@ -67,7 +67,7 @@ class TestListDatasources(common.TestCongressBase):
|
||||
result = cmd.take_action(parsed_args)
|
||||
|
||||
lister.assert_called_with()
|
||||
self.assertEqual(['id', 'name', 'enabled', 'type', 'config'],
|
||||
self.assertEqual(['id', 'name', 'enabled', 'driver', 'config'],
|
||||
result[0])
|
||||
# get 'config' column
|
||||
config = list(result[1])[0][-1]
|
||||
|
||||
Reference in New Issue
Block a user