Merge "Adding support for displaying cluster error details"
This commit is contained in:
commit
20cba4a6ab
|
@ -57,6 +57,10 @@
|
||||||
"null"
|
"null"
|
||||||
],
|
],
|
||||||
"description": "Cluster volume"
|
"description": "Cluster volume"
|
||||||
|
},
|
||||||
|
"error_detail": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Cluster error description"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,18 @@ class V1(fixtures.Fixture):
|
||||||
"status": "BUILDING",
|
"status": "BUILDING",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.cluster_error = {
|
||||||
|
"name": "test-cluster3",
|
||||||
|
"id": "00000000-0000-0000-0000-000000008765",
|
||||||
|
"size": 3,
|
||||||
|
"network_id": ["05567na0-f7aa-6820-7afcd-7dd6e9963cd9"],
|
||||||
|
"created_at": "2015-01-01T00:00:00+00:00",
|
||||||
|
"endpoints": [],
|
||||||
|
"flavor": "1",
|
||||||
|
"status": "ERROR",
|
||||||
|
"error_detail": "cluster error detailed message",
|
||||||
|
}
|
||||||
|
|
||||||
self.new_cluster = {
|
self.new_cluster = {
|
||||||
"name": "new-test-cluster",
|
"name": "new-test-cluster",
|
||||||
"id": "00000000-0000-0000-0000-000000009012",
|
"id": "00000000-0000-0000-0000-000000009012",
|
||||||
|
@ -65,7 +77,7 @@ class V1(fixtures.Fixture):
|
||||||
"status": "BUILDING",
|
"status": "BUILDING",
|
||||||
}
|
}
|
||||||
|
|
||||||
clusters = [self.cluster_1234, self.cluster_5678]
|
clusters = [self.cluster_1234, self.cluster_5678, self.cluster_error]
|
||||||
|
|
||||||
self.requests.register_uri('GET', self.url(),
|
self.requests.register_uri('GET', self.url(),
|
||||||
json=clusters,
|
json=clusters,
|
||||||
|
|
|
@ -26,7 +26,10 @@ class TestListClusters(base.TestCueBase):
|
||||||
'test-cluster', 'ACTIVE', 1, []),
|
'test-cluster', 'ACTIVE', 1, []),
|
||||||
'00000000-0000-0000-0000-000000005678':
|
'00000000-0000-0000-0000-000000005678':
|
||||||
('00000000-0000-0000-0000-000000005678',
|
('00000000-0000-0000-0000-000000005678',
|
||||||
'test-cluster2', 'BUILDING', 3, [])}
|
'test-cluster2', 'BUILDING', 3, []),
|
||||||
|
'00000000-0000-0000-0000-000000008765':
|
||||||
|
('00000000-0000-0000-0000-000000008765',
|
||||||
|
'test-cluster3', 'ERROR', 3, [])}
|
||||||
|
|
||||||
result = self.execute(clusters.ListClustersCommand, arglist,
|
result = self.execute(clusters.ListClustersCommand, arglist,
|
||||||
verifylist)
|
verifylist)
|
||||||
|
@ -55,6 +58,24 @@ class TestShowCluster(base.TestCueBase):
|
||||||
self.assert_called('GET', '/clusters/' + cluster_id)
|
self.assert_called('GET', '/clusters/' + cluster_id)
|
||||||
self.assertEqual(expected, result)
|
self.assertEqual(expected, result)
|
||||||
|
|
||||||
|
def test_show_cluster_error(self):
|
||||||
|
"""test cluster show when in error state."""
|
||||||
|
cluster_id = '00000000-0000-0000-0000-000000008765'
|
||||||
|
arglist = [cluster_id]
|
||||||
|
verifylist = []
|
||||||
|
|
||||||
|
result = self.execute(clusters.ShowClusterCommand, arglist, verifylist)
|
||||||
|
expected = [('created_at', 'endpoints', 'error_detail', 'flavor', 'id',
|
||||||
|
'name', 'network_id', 'size', 'status'),
|
||||||
|
(u'2015-01-01T00:00:00+00:00', [],
|
||||||
|
'cluster error detailed message', '1',
|
||||||
|
'00000000-0000-0000-0000-000000008765',
|
||||||
|
'test-cluster3',
|
||||||
|
[u'05567na0-f7aa-6820-7afcd-7dd6e9963cd9'],
|
||||||
|
3, 'ERROR')]
|
||||||
|
self.assert_called('GET', '/clusters/' + cluster_id)
|
||||||
|
self.assertEqual(expected, result)
|
||||||
|
|
||||||
def test_show_cluster_without_id(self):
|
def test_show_cluster_without_id(self):
|
||||||
"""test show cluster without specifying cluster id"""
|
"""test show cluster without specifying cluster id"""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue