def wait_for_daemon_to_initialize(self, storlet_name):
        """
        Send a Ping service datagram. Validate that
        Daemon response is correct. Give up after the
        predefined number of attempts (5)

        :param storlet_name: Storlet name we are checking the daemon for
        :returns: (Status, Description text of possible error)
        """
        storlet_pipe_name = self.storlet_name_to_pipe_name[storlet_name]
        self.logger.debug('Send PING command to {0} via {1}'.
                          format(storlet_name, storlet_pipe_name))
        # TODO(takashi): We had better use contextmanager
        read_fd, write_fd = os.pipe()
        dtg = SBusDatagram.create_service_datagram(SBUS_CMD_PING, write_fd)
        b_status = False
        error_text = "Daemon isn't responding"
        for i in range(self.NUM_OF_TRIES_PINGING_STARTING_DAEMON):
            ret = SBus.send(storlet_pipe_name, dtg)
            if (ret >= 0):
                resp = os.read(read_fd, 128)
                if 'OK' == resp:
                    b_status = True
                    error_text = 'OK'
                    break
            time.sleep(1)
        os.close(read_fd)
        os.close(write_fd)
        return b_status, error_text
dataset/ETHPy150Open openstack/storlets/Engine/storlet_daemon_factory/daemon_factory.py/daemon_factory.wait_for_daemon_to_initialize/original