summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-03-23 09:46:24 +0000
committerGerrit Code Review <review@openstack.org>2017-03-23 09:46:24 +0000
commit2ec2a93d5361238e64fa4ba6d05616037ab8ad87 (patch)
tree5a1c8b5f51b438de629785b77f0da14a152db6f8
parent7aa506469b22be06e092d1020190a36847b893ba (diff)
parent2caa56fa6e6d70b62d60867b78f0dddb33aa6b18 (diff)
Merge "Moving task cache update into task creation transaction"
-rw-r--r--nailgun/nailgun/task/task.py33
1 files changed, 12 insertions, 21 deletions
diff --git a/nailgun/nailgun/task/task.py b/nailgun/nailgun/task/task.py
index 031792b..e0ee772 100644
--- a/nailgun/nailgun/task/task.py
+++ b/nailgun/nailgun/task/task.py
@@ -946,24 +946,18 @@ class StopDeploymentTask(object):
946 } 946 }
947 } 947 }
948 ) 948 )
949 db().commit()
950 return rpc_message 949 return rpc_message
951 950
952 @classmethod 951 @classmethod
953 def execute(cls, task, deploy_task=None, provision_task=None): 952 def execute(cls, task, deploy_task=None, provision_task=None):
954 db().commit() 953 messages = []
955 if provision_task: 954 if provision_task:
956 rpc.cast( 955 messages.append(cls.message(task, provision_task))
957 'naily',
958 cls.message(task, provision_task),
959 service=True
960 )
961 if deploy_task: 956 if deploy_task:
962 rpc.cast( 957 messages.append(cls.message(task, deploy_task))
963 'naily', 958 db().commit()
964 cls.message(task, deploy_task), 959 for msg in messages:
965 service=True 960 rpc.cast('naily', msg, service=True)
966 )
967 961
968 962
969class ResetEnvironmentTask(object): 963class ResetEnvironmentTask(object):
@@ -1962,8 +1956,9 @@ class CheckRepoAvailability(BaseNetworkVerification):
1962 return rpc_message 1956 return rpc_message
1963 1957
1964 def execute(self): 1958 def execute(self):
1959 message = self.get_message()
1965 db().commit() 1960 db().commit()
1966 rpc.cast('naily', self.get_message()) 1961 rpc.cast('naily', message)
1967 1962
1968 def _get_nodes_to_check(self): 1963 def _get_nodes_to_check(self):
1969 nodes = [{'uid': consts.MASTER_NODE_UID}] 1964 nodes = [{'uid': consts.MASTER_NODE_UID}]
@@ -2091,11 +2086,9 @@ class CreateStatsUserTask(object):
2091 2086
2092 @classmethod 2087 @classmethod
2093 def execute(cls, task, primary_controller): 2088 def execute(cls, task, primary_controller):
2089 message = cls.message(task, primary_controller)
2094 db().commit() 2090 db().commit()
2095 rpc.cast( 2091 rpc.cast('naily', message)
2096 'naily',
2097 cls.message(task, primary_controller)
2098 )
2099 2092
2100 2093
2101class RemoveStatsUserTask(object): 2094class RemoveStatsUserTask(object):
@@ -2124,11 +2117,9 @@ class RemoveStatsUserTask(object):
2124 2117
2125 @classmethod 2118 @classmethod
2126 def execute(cls, task, primary_controller): 2119 def execute(cls, task, primary_controller):
2120 message = cls.message(task, primary_controller)
2127 db().commit() 2121 db().commit()
2128 rpc.cast( 2122 rpc.cast('naily', message)
2129 'naily',
2130 cls.message(task, primary_controller)
2131 )
2132 2123
2133 2124
2134class UpdateOpenstackConfigTask(BaseDeploymentTask): 2125class UpdateOpenstackConfigTask(BaseDeploymentTask):