Merge "Fix KeyError in deployment history page"
This commit is contained in:
commit
57a3434c3f
|
@ -728,7 +728,7 @@ def get_deployment_history_services(deployment):
|
|||
service_type = service['?']['type']
|
||||
if service_type.find('/') != -1:
|
||||
service_type = service_type[:service_type.find('/')]
|
||||
services[service['name']] = service_type
|
||||
services[service.get('name', service['?']['name'])] = service_type
|
||||
context = {
|
||||
"services": services,
|
||||
}
|
||||
|
|
|
@ -863,8 +863,10 @@ class TestDeploymentHistoryTable(testtools.TestCase):
|
|||
mock.sentinel.rendered_template
|
||||
|
||||
test_description = {'services': [
|
||||
{'name': 'foo_service', '?': {'type': 'foo/bar'}},
|
||||
{'name': 'bar_service', '?': {'type': 'baz/qux'}}
|
||||
{'name': 'foo_service', '?': {'type': 'foo/bar',
|
||||
'name': 'foo_service'}},
|
||||
{'name': 'bar_service', '?': {'type': 'baz/qux',
|
||||
'name': 'bar_service'}}
|
||||
]}
|
||||
mock_deployment = mock.Mock(description=test_description)
|
||||
|
||||
|
|
Loading…
Reference in New Issue