示例#1
0
    def _do_startup(self):
        """Start up the service. The first node will be an agent running a
        BluePrint Hub and a BluePrint Node."""

        vals = {'action': '_do_startup', 'count': 1}
        self.logger.debug(self.ACTION_REQUESTING_NODES % vals)

        try:
            nodes = self.controller.create_nodes(1, client.check_agent_process,
                                                 self.AGENT_PORT)

            hub_node = nodes[0]

            # The first agent is a BluePrint Hub and a BluePrint Node
            client.create_hub(hub_node.ip, self.AGENT_PORT)
            client.create_node(hub_node.ip, self.AGENT_PORT, hub_node.ip)

            self.hub_ip = hub_node.ip

            # Extend the nodes list with the newly created one
            self.nodes += nodes
            self.state = self.S_RUNNING
        except Exception, err:
            self.logger.exception('_do_startup: Failed to create hub: %s' %
                                  err)
            self.state = self.S_ERROR
示例#2
0
    def _do_startup(self):
        """Start up the service. The first node will be an agent running a
        BluePrint Hub and a BluePrint Node."""

        vals = { 'action': '_do_startup', 'count': 1 }
        self.logger.debug(self.ACTION_REQUESTING_NODES % vals)

        try:
            nodes = self.controller.create_nodes(1,
                client.check_agent_process, self.AGENT_PORT)

            hub_node = nodes[0]

            # The first agent is a BluePrint Hub and a BluePrint Node
            client.create_hub(hub_node.ip, self.AGENT_PORT)
            client.create_node(hub_node.ip, self.AGENT_PORT, hub_node.ip)

            self.hub_ip = hub_node.ip

            # Extend the nodes list with the newly created one
            self.nodes += nodes
            self.state = self.S_RUNNING
        except Exception, err:
            self.logger.exception('_do_startup: Failed to create hub: %s' % err)
            self.state = self.S_ERROR
示例#3
0
    def _do_add_nodes(self, count):
        """Add 'count' BluePrint Nodes to this deployment"""
        node_instances = self.controller.create_nodes(
            count, client.check_agent_process, self.AGENT_PORT)

        # Startup agents
        for node in node_instances:
            client.create_node(node.ip, self.AGENT_PORT, self.hub_ip)

        self.nodes += node_instances
        self.state = self.S_RUNNING
示例#4
0
    def _do_add_nodes(self, count):
        """Add 'count' BluePrint Nodes to this deployment"""
        node_instances = self.controller.create_nodes(count, 
            client.check_agent_process, self.AGENT_PORT)

        # Startup agents
        for node in node_instances:
            client.create_node(node.ip, self.AGENT_PORT, self.hub_ip)

        self.nodes += node_instances
        self.state = self.S_RUNNING