Apply config.

def config(self, config_text, plane):
        """Apply config."""
        nol = config_text.count('\n')
        config_lines = iter(config_text.splitlines())
        events = [self.prompt_re, self.syntax_error_re]
        transitions = [
            (self.prompt_re, [0], 0, partial(a_send_line, config_lines), 10),
            (self.syntax_error_re, [0], -1, CommandSyntaxError("Configuration syntax error."), 0)
        ]
        self.device.ctrl.send_command(self.config_cmd)
        fsm = FSM("CONFIG", self.device, events, transitions, timeout=10, max_transitions=nol + 5)
        fsm.run()

        # after the configuration the hostname may change. Need to detect it again
        try:
            self.device.send("", timeout=2)
        except CommandTimeoutError:
            prompt = self.device.ctrl.detect_prompt()
            self.device.prompt_re = self.make_dynamic_prompt(prompt)
            self.device.update_config_mode(prompt)

        if self.device.mode == "config":
            self.device.send("end")

        self.device.send("write memory")

        return "NO-COMMIT-ID"