Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion st2common/st2common/service_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from tooz.coordination import GroupAlreadyExist
from tooz.coordination import GroupNotCreated
from tooz.coordination import MemberNotJoined
from tooz.coordination import MemberAlreadyExist

from st2common import log as logging
from st2common.constants.logging import DEFAULT_LOGGING_CONF_PATH
Expand Down Expand Up @@ -341,7 +342,10 @@ def register_service_in_service_registry(service, capabilities=None, start_heart
'Joining service registry group "%s" as member_id "%s" with capabilities "%s"'
% (group_id, member_id, capabilities)
)
return coordinator.join_group(group_id, capabilities=capabilities).get()
try:
return coordinator.join_group(group_id, capabilities=capabilities).get()
except MemberAlreadyExist:
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More comment on legacy, but in the try we return whatever coordinator.join_group returns, but if memberalreadyexists we don't return anything...
I think in fact the join_group doesn't return anything - so probably just worth changing it so that we change the try to remove the "return" on the call to coordinator.join_group. Or if its expected to return something then we need to adjust the except clause...



def deregister_service(service, start_heart=True):
Expand Down