Fixed terminate_unneeded_clusters fail in distributed mode

Change-Id: I382508ce2ce9b68dca12ab4c716f8ac58eb23f09
Closes-Bug: #1363029
Merge "Fixed terminate_unneeded_clusters fail in distributed mode"