Merge "Show overcloud detail with right cond"

This commit is contained in:
Jenkins
2014-02-11 19:36:50 +00:00
committed by Gerrit Code Review
2 changed files with 6 additions and 5 deletions

View File

@@ -36,8 +36,8 @@ class OvercloudTests(test.BaseAdminViewTests):
def test_index_overcloud_undeployed_get(self):
oc = None
with patch('tuskar_ui.api.Overcloud', **{
'spec_set': ['get', 'is_deployed'],
'is_deployed': False,
'spec_set': ['get', 'stack'],
'stack': None,
'get.side_effect': lambda request, overcloud_id: oc,
}) as Overcloud:
oc = api.Overcloud
@@ -84,9 +84,10 @@ class OvercloudTests(test.BaseAdminViewTests):
def test_index_overcloud_deployed(self):
oc = None
stack = TEST_DATA.heatclient_stacks.first()
with patch('tuskar_ui.api.Overcloud', **{
'spec_set': ['get', 'is_deployed', 'id'],
'is_deployed': True,
'spec_set': ['get', 'stack', 'id'],
'stack': stack,
'id': 1,
'get.side_effect': lambda request, overcloud_id: oc,
}) as Overcloud:

View File

@@ -33,7 +33,7 @@ class IndexView(base_views.RedirectView):
def get_redirect_url(self):
overcloud = api.Overcloud.get(self.request, 1)
if overcloud is not None and overcloud.is_deployed:
if overcloud is not None and overcloud.stack is not None:
redirect = reverse('horizon:infrastructure:overcloud:detail',
args=(overcloud.id,))
else: