Merge "Allow network modifications if cluster is not locked"

This commit is contained in:
Jenkins 2016-04-15 12:26:28 +00:00 committed by Gerrit Code Review
commit b9060fe14f
3 changed files with 5 additions and 7 deletions

View File

@ -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):

View File

@ -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

View File

@ -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()