# Path: lighthouse/haproxy/directives.py



import logging
from ..directives import directives_by_section
        for line in lines:
            self.add_line(line)

    def add_line(self, line):
        """
        Adds a given line string to the list of lines, validating the line
        first.
        """
        if not self.is_valid_line(line):
            logger.warn(
                "Invalid line for %s section: '%s'",
                self.section_name, line
            )
            return

        self.lines.append(line)

    def is_valid_line(self, line):
        """
        Validates a given line against the associated "section" (e.g. 'global'
        or 'frontend', etc.) of a stanza.

        If a line represents a directive that shouldn't be within the stanza
        it is rejected.  See the `directives.json` file for a condensed look
        at valid directives based on section.
        """
        adjusted_line = line.strip().lower()

        return any([
            adjusted_line.startswith(directive)

# Path: lighthouse/haproxy/directives.py



# Path: lighthouse/haproxy/stanzas/stanza.py
import logging
from ..directives import directives_by_section

        for line in lines:
            self.add_line(line)

    def add_line(self, line):
        """
        Adds a given line string to the list of lines, validating the line
        first.
        """
        if not self.is_valid_line(line):
            logger.warn(
                "Invalid line for %s section: '%s'",
                self.section_name, line
            )
            return

        self.lines.append(line)

    def is_valid_line(self, line):
        """
        Validates a given line against the associated "section" (e.g. 'global'
        or 'frontend', etc.) of a stanza.

        If a line represents a directive that shouldn't be within the stanza
        it is rejected.  See the `directives.json` file for a condensed look
        at valid directives based on section.
        """
        adjusted_line = line.strip().lower()

        return any([
            adjusted_line.startswith(directive)

            for directive in directives_by_section[self.section_name]