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))
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)))
def strategy(self, strategy): self.logger.info('start processes using strategy {}'.format( DeploymentStrategies._to_string(strategy))) self._strategy = strategy