Merge "Fix cluster health check faild"
This commit is contained in:
commit
a42e321f8a
@ -87,8 +87,8 @@ class NovaNotificationEndpoint(object):
|
||||
node_id = meta.get('cluster_node_id')
|
||||
if node_id:
|
||||
LOG.info("Requesting node recovery: %s", node_id)
|
||||
ctx = context.get_service_context(project=self.project_id,
|
||||
user=payload['user_id'])
|
||||
ctx = context.get_service_context(project_id=self.project_id,
|
||||
user_id=payload['user_id'])
|
||||
req = objects.NodeRecoverRequest(identity=node_id,
|
||||
params=params)
|
||||
self.rpc.call(ctx, 'node_recover', req)
|
||||
@ -154,8 +154,8 @@ class HeatNotificationEndpoint(object):
|
||||
'operation': self.recover_action['operation'],
|
||||
}
|
||||
LOG.info("Requesting stack recovery: %s", node_id)
|
||||
ctx = context.get_service_context(project=self.project_id,
|
||||
user=payload['user_identity'])
|
||||
ctx = context.get_service_context(project_id=self.project_id,
|
||||
user_id=payload['user_identity'])
|
||||
req = objects.NodeRecoverRequest(identity=node_id, params=params)
|
||||
self.rpc.call(ctx, 'node_recover', req)
|
||||
|
||||
@ -250,8 +250,8 @@ class HealthManager(service.Service):
|
||||
LOG.warning("Cluster (%s) is not found.", cluster_id)
|
||||
return _chase_up(start_time, timeout)
|
||||
|
||||
ctx = context.get_service_context(user=cluster.user,
|
||||
project=cluster.project)
|
||||
ctx = context.get_service_context(user_id=cluster.user,
|
||||
project_id=cluster.project)
|
||||
params = {'delete_check_action': True}
|
||||
try:
|
||||
req = objects.ClusterCheckRequest(identity=cluster_id,
|
||||
|
@ -605,8 +605,8 @@ class TestHealthManager(base.SenlinTestCase):
|
||||
self.assertEqual(mock_chase.return_value, res)
|
||||
mock_get.assert_called_once_with(self.hm.ctx, 'CLUSTER_ID',
|
||||
project_safe=False)
|
||||
mock_ctx.assert_called_once_with(user=x_cluster.user,
|
||||
project=x_cluster.project)
|
||||
mock_ctx.assert_called_once_with(user_id=x_cluster.user,
|
||||
project_id=x_cluster.project)
|
||||
mock_rpc.assert_has_calls([
|
||||
mock.call(ctx, 'cluster_check', mock.ANY),
|
||||
mock.call(ctx, 'node_recover', mock.ANY)
|
||||
@ -647,7 +647,8 @@ class TestHealthManager(base.SenlinTestCase):
|
||||
self.assertEqual(mock_chase.return_value, res)
|
||||
mock_get.assert_called_once_with(self.hm.ctx, 'CLUSTER_ID',
|
||||
project_safe=False)
|
||||
mock_ctx.assert_called_once_with(user='USER_ID', project='PROJECT_ID')
|
||||
mock_ctx.assert_called_once_with(user_id='USER_ID',
|
||||
project_id='PROJECT_ID')
|
||||
mock_check.assert_called_once_with(ctx, 'cluster_check', mock.ANY)
|
||||
mock_chase.assert_called_once_with(mock.ANY, 123)
|
||||
|
||||
@ -673,7 +674,8 @@ class TestHealthManager(base.SenlinTestCase):
|
||||
self.assertEqual(mock_chase.return_value, res)
|
||||
mock_get.assert_called_once_with(self.hm.ctx, 'CLUSTER_ID',
|
||||
project_safe=False)
|
||||
mock_ctx.assert_called_once_with(user='USER_ID', project='PROJECT_ID')
|
||||
mock_ctx.assert_called_once_with(user_id='USER_ID',
|
||||
project_id='PROJECT_ID')
|
||||
mock_rpc.assert_called_once_with(ctx, 'cluster_check', mock.ANY)
|
||||
mock_wait.assert_called_once_with(ctx, "CHECK_ID", 456)
|
||||
mock_chase.assert_called_once_with(mock.ANY, 456)
|
||||
|
Loading…
Reference in New Issue
Block a user