Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Commit

Permalink
storage: StorageService no longer handles container work.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashcrow committed Dec 1, 2016
1 parent 339b4f6 commit 922f248
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions src/commissaire_service/storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import importlib
import json

from time import sleep

import commissaire.models as models

from commissaire import constants as C
Expand Down Expand Up @@ -230,41 +228,6 @@ def on_list_store_handlers(self, message):
})
return result

def on_node_registered(self, message, cluster_type, address):
"""
Checks if a cluster node at the given address is registered on a
cluster of the given type. This method may take several seconds
to complete if the cluster node is unresponsive, as it retries a
few times with a sleep delay.
:param message: A message instance
:type message: kombu.message.Message
:param cluster_type: A cluster type constant
:type cluster_type: str
:param address: Address of the cluster node
:type address: str
:returns: Whether the node is registered
:rtype: bool
"""
for con_mgr in self._manager.list_container_managers(cluster_type):
# Try 3 times waiting 5 seconds each time before giving up.
for attempt in range(3):
if con_mgr.node_registered(address):
self.logger.info(
'{} has been registered with the '
'container manager'.format(address))
return True
if attempt == 2:
self.logger.warn(
'Could not register with the container manager')
return False
self.logger.debug(
'{} has not been registered with the container '
'manager. Checking again in 5 seconds...'.format(
address))
sleep(5)
return False


def main(): # pragma: no cover
"""
Expand Down

0 comments on commit 922f248

Please sign in to comment.