From fc55b01678827dd3b266280379ca3532cd8dd679 Mon Sep 17 00:00:00 2001 From: fengbeihong Date: Mon, 24 Oct 2016 11:19:56 +0800 Subject: [PATCH] Fix magnum cluster-update error Closes-Bug: #1636050 Change-Id: I498b0ff477f451e48a95881b8b63f3840016ac3f --- magnum/conductor/scale_manager.py | 2 +- magnum/tests/unit/conductor/test_scale_manager.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/magnum/conductor/scale_manager.py b/magnum/conductor/scale_manager.py index 6bcd21e405..b2056d4d86 100644 --- a/magnum/conductor/scale_manager.py +++ b/magnum/conductor/scale_manager.py @@ -29,7 +29,7 @@ LOG = logging.getLogger(__name__) def get_scale_manager(context, osclient, cluster): manager = None - coe = cluster.baymodel.coe + coe = cluster.cluster_template.coe if coe == 'kubernetes': manager = K8sScaleManager(context, osclient, cluster) elif coe == 'mesos': diff --git a/magnum/tests/unit/conductor/test_scale_manager.py b/magnum/tests/unit/conductor/test_scale_manager.py index cf02865bcf..db69745cc5 100644 --- a/magnum/tests/unit/conductor/test_scale_manager.py +++ b/magnum/tests/unit/conductor/test_scale_manager.py @@ -26,11 +26,11 @@ class TestScaleManager(base.TestCase): mock_context = mock.MagicMock() mock_osc = mock.MagicMock() k8s_cluster = mock.MagicMock() - k8s_cluster.baymodel.coe = 'kubernetes' + k8s_cluster.cluster_template.coe = 'kubernetes' mesos_cluster = mock.MagicMock() - mesos_cluster.baymodel.coe = 'mesos' + mesos_cluster.cluster_template.coe = 'mesos' invalid_cluster = mock.MagicMock() - invalid_cluster.baymodel.coe = 'fake' + invalid_cluster.cluster_template.coe = 'fake' mgr = scale_manager.get_scale_manager( mock_context, mock_osc, k8s_cluster)