diff --git a/nailgun/nailgun/objects/cluster.py b/nailgun/nailgun/objects/cluster.py index 461d587f36..3989be3d66 100644 --- a/nailgun/nailgun/objects/cluster.py +++ b/nailgun/nailgun/objects/cluster.py @@ -1324,11 +1324,7 @@ class Cluster(NailgunObject): The result depends on the current status of cluster. """ - allowed = [consts.CLUSTER_STATUSES.new, - consts.CLUSTER_STATUSES.stopped, - consts.CLUSTER_STATUSES.operational, - consts.CLUSTER_STATUSES.error] - return instance.status not in allowed + return instance.is_locked @classmethod def is_component_enabled(cls, instance, component): diff --git a/nailgun/nailgun/test/unit/test_network_template_handler.py b/nailgun/nailgun/test/unit/test_network_template_handler.py index 452338604f..8152b817dc 100644 --- a/nailgun/nailgun/test/unit/test_network_template_handler.py +++ b/nailgun/nailgun/test/unit/test_network_template_handler.py @@ -166,7 +166,8 @@ class TestHandlers(BaseIntegrationTest): allowed = [consts.CLUSTER_STATUSES.new, consts.CLUSTER_STATUSES.stopped, consts.CLUSTER_STATUSES.operational, - consts.CLUSTER_STATUSES.error] + consts.CLUSTER_STATUSES.error, + consts.CLUSTER_STATUSES.partially_deployed] for status in consts.CLUSTER_STATUSES: cluster.status = status # need commit because rollback is called when handler exits with diff --git a/nailgun/nailgun/test/unit/test_objects.py b/nailgun/nailgun/test/unit/test_objects.py index 6145bb6096..f7e9e744a8 100644 --- a/nailgun/nailgun/test/unit/test_objects.py +++ b/nailgun/nailgun/test/unit/test_objects.py @@ -1204,7 +1204,8 @@ class TestClusterObject(BaseTestCase): allowed = [consts.CLUSTER_STATUSES.new, consts.CLUSTER_STATUSES.stopped, consts.CLUSTER_STATUSES.operational, - consts.CLUSTER_STATUSES.error] + consts.CLUSTER_STATUSES.error, + consts.CLUSTER_STATUSES.partially_deployed] for status in consts.CLUSTER_STATUSES: self.env.clusters[0].status = status self.db.flush()