(service, start_heart=True)
| 345 | |
| 346 | |
| 347 | def deregister_service(service, start_heart=True): |
| 348 | |
| 349 | if not isinstance(service, six.binary_type): |
| 350 | group_id = service.encode("utf-8") |
| 351 | else: |
| 352 | group_id = service |
| 353 | |
| 354 | coordinator = coordination.get_coordinator(start_heart=start_heart) |
| 355 | |
| 356 | member_id = coordination.get_member_id() |
| 357 | LOG.debug( |
| 358 | 'Leaving service registry group "%s" as member_id "%s"' % (group_id, member_id) |
| 359 | ) |
| 360 | try: |
| 361 | coordinator.leave_group(group_id).get() |
| 362 | except (GroupNotCreated, MemberNotJoined): |
| 363 | pass |
no test coverage detected