示例#1
0
 def test_DeploymentStrategies(self):
     """ Test the DeploymentStrategies enumeration. """
     from supvisors.ttypes import DeploymentStrategies
     self.assertEqual(
         'CONFIG',
         DeploymentStrategies._to_string(DeploymentStrategies.CONFIG))
     self.assertEqual(
         'LESS_LOADED',
         DeploymentStrategies._to_string(DeploymentStrategies.LESS_LOADED))
     self.assertEqual(
         'MOST_LOADED',
         DeploymentStrategies._to_string(DeploymentStrategies.MOST_LOADED))
示例#2
0
 def set_deployment_strategy(self, strategy):
     """ Update deployment strategy. """
     self.supvisors.starter.strategy = strategy
     return delayed_info('Deployment strategy set to {}'.format(
         DeploymentStrategies._to_string(strategy)))
示例#3
0
 def strategy(self, strategy):
     self.logger.info('start processes using strategy {}'.format(
         DeploymentStrategies._to_string(strategy)))
     self._strategy = strategy