Пример #1
0
 def get_helloworld(self, kwargs):
     if self.state != self.S_RUNNING:
         return HttpErrorResponse('ERROR: Wrong state to get_helloworld')
     # Just get_helloworld from all the agents
     for node in self.nodes:
         data = client.get_helloworld(node.ip, 5555)
         self.logger.info('Received %s from %s', data, node.id)
     return HttpJsonResponse({
         'helloworld': [node.id for node in self.nodes],
     })
Пример #2
0
 def get_helloworld(self, kwargs):
     if self.state != self.S_RUNNING:
         return HttpErrorResponse('ERROR: Wrong state to get_helloworld')
     # Just get_helloworld from all the agents
     for node in self.nodes:
         data = client.get_helloworld(node.ip, 5555)
         self.logger.info('Received %s from %s', data, node.id)
     return HttpJsonResponse({
         'helloworld': [ node.id for node in self.nodes ],
         })
Пример #3
0
    def get_helloworld(self, kwargs):
        if self.state != self.S_RUNNING:
            return HttpErrorResponse('ERROR: Wrong state to get_helloworld')

        messages = []

        # Just get_helloworld from all the agents
        for node in self.nodes:
            data = client.get_helloworld(node.ip, 5555)
            message = 'Received %s from %s' % (data, node.id)
            self.logger.info(message)
            messages.append(message)

        return HttpJsonResponse({ 'helloworld': "\n".join(messages) })
Пример #4
0
    def get_helloworld(self, kwargs):
        if self.state != self.S_RUNNING:
            return HttpErrorResponse('ERROR: Wrong state to get_helloworld')

        messages = []

        # Just get_helloworld from all the agents
        for node in self.nodes:
            data = client.get_helloworld(node.ip, 5555)
            message = 'Received %s from %s' % (data, node.id)
            self.logger.info(message)
            messages.append(message)

        return HttpJsonResponse({'helloworld': "\n".join(messages)})
Пример #5
0
    def get_helloworld(self, kwargs):
        try:
            exp_params = []
            check_arguments(exp_params, kwargs)
            self.check_state([self.S_RUNNING])
        except Exception as ex:
            return HttpErrorResponse("%s" % ex)

        messages = []

        # Just get_helloworld from all the agents
        for node in self.nodes:
            data = client.get_helloworld(node.ip, self.AGENT_PORT)
            message = 'Received %s from %s' % (data['result'], node.id)
            self.logger.info(message)
            messages.append(message)

        return HttpJsonResponse({ 'helloworld': "\n".join(messages) })