Fix magnum cluster-update error

Closes-Bug: #1636050
Change-Id: I498b0ff477f451e48a95881b8b63f3840016ac3f
This commit is contained in:
fengbeihong 2016-10-24 11:19:56 +08:00
parent 68af88a737
commit fc55b01678
2 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ LOG = logging.getLogger(__name__)
def get_scale_manager(context, osclient, cluster): def get_scale_manager(context, osclient, cluster):
manager = None manager = None
coe = cluster.baymodel.coe coe = cluster.cluster_template.coe
if coe == 'kubernetes': if coe == 'kubernetes':
manager = K8sScaleManager(context, osclient, cluster) manager = K8sScaleManager(context, osclient, cluster)
elif coe == 'mesos': elif coe == 'mesos':

View File

@ -26,11 +26,11 @@ class TestScaleManager(base.TestCase):
mock_context = mock.MagicMock() mock_context = mock.MagicMock()
mock_osc = mock.MagicMock() mock_osc = mock.MagicMock()
k8s_cluster = mock.MagicMock() k8s_cluster = mock.MagicMock()
k8s_cluster.baymodel.coe = 'kubernetes' k8s_cluster.cluster_template.coe = 'kubernetes'
mesos_cluster = mock.MagicMock() mesos_cluster = mock.MagicMock()
mesos_cluster.baymodel.coe = 'mesos' mesos_cluster.cluster_template.coe = 'mesos'
invalid_cluster = mock.MagicMock() invalid_cluster = mock.MagicMock()
invalid_cluster.baymodel.coe = 'fake' invalid_cluster.cluster_template.coe = 'fake'
mgr = scale_manager.get_scale_manager( mgr = scale_manager.get_scale_manager(
mock_context, mock_osc, k8s_cluster) mock_context, mock_osc, k8s_cluster)