Skip to content

Commit

Permalink
Added event log for newly added nodes to the cluster
Browse files Browse the repository at this point in the history
tendrl-bug-id: #805
Signed-off-by: Shubhendu <shtripat@redhat.com>
  • Loading branch information
Shubhendu committed Feb 27, 2018
1 parent 089a6b3 commit 83104c3
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def run(self):
"import" % integration_id)

job_ids = []
new_peers = []
for node_id in node_ids:
_cnc = NS.tendrl.objects.ClusterNodeContext(
node_id=node_id
Expand Down Expand Up @@ -99,10 +100,11 @@ def run(self):
job_id=self.parameters['job_id']
)
job_ids.append(_job_id)
new_peers.append(node_id)

loop_count = 0
# Wait for (no of nodes) * 6 minutes for import to complete
wait_count = len(node_ids) * 36
wait_count = len(job_ids) * 36
while True:
if loop_count >= wait_count:
logger.log(
Expand Down Expand Up @@ -141,4 +143,16 @@ def run(self):
'job_id': self.job_id
}
_cluster.save()

logger.log(
"info",
NS.publisher_id,
{
"message": "Newly detected node(s) added to the cluster."
"(nodes: %s) (integration_id: %s)" % (
str(new_peers),
integration_id
)
}
)
return True

0 comments on commit 83104c3

Please sign in to comment.