Module Expr Str Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Dict Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body For NameStore NameLoad body If Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num orelse If BoolOpOr CompareEq SubscriptLoad NameLoad Index Num ListLoad Str CompareEq SubscriptLoad NameLoad Index Num ListLoad Str body For NameStore SubscriptLoad NameLoad Index Num body If Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num orelse If BoolOpAnd CompareEq SubscriptLoad NameLoad Index Num ListLoad Str CompareEq SubscriptLoad NameLoad Index Num ListLoad Str body For NameStore SubscriptLoad NameLoad Index Num body If Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore NameLoad Assign NameStore ListLoad Assign NameStore Dict For NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign SubscriptStore NameLoad Index NameLoad ListLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Expr Call NameLoad NameLoad Lambda arguments args NameParam defaults CompareEq SubscriptLoad NameLoad Index Num ListLoad Str Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num For TupleStore NameStore NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad NameLoad For NameStore NameLoad body For NameStore SubscriptLoad NameLoad Index NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str NameLoad SubscriptLoad NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad For NameStore NameLoad body If Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num For NameStore NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad handlers ExceptHandler type NameLoad body Pass Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad For NameStore NameLoad body If BoolOpAnd CompareIn NameLoad AttributeLoad NameLoad attr UnaryOpNot NameLoad body Continue TryExcept body With Call NameLoad NameLoad NameStore body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad ExceptHandler type AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad orelse Assign NameStore NameLoad Assign NameStore NameLoad Return Dict Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str For NameStore NameLoad body If Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad body Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Raise Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults Str body Expr Str For NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If NameLoad body Assign NameStore BinOpAdd BinOpAdd NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr Str NameLoad Call AttributeLoad NameLoad attr NameLoad With Call NameLoad NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareEq Call NameLoad NameLoad Num body Return NameLoad If UnaryOpNot Call NameLoad NameLoad NameLoad body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad For NameStore NameLoad body If UnaryOpNot Call NameLoad NameLoad NameLoad body Return NameLoad If BoolOpAnd CompareGt Call NameLoad NameLoad Num CompareEq SubscriptLoad NameLoad Index Num Str body Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Num Return CompareEq NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str TryExcept body Expr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr NameLoad NameLoad Lambda arguments args NameParam defaults Call NameLoad NameLoad NameLoad NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Raise Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Lambda arguments args NameParam defaults CompareEq SubscriptLoad NameLoad Index Num ListLoad Str Lambda arguments args NameParam defaults Call AttributeLoad SubscriptLoad NameLoad Index Num attr Num NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr For NameStore NameLoad body Assign NameStore ListLoad NameLoad NameLoad AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body For NameStore AttributeLoad NameLoad attr body If CompareEq SubscriptLoad NameLoad Index Num Str body Assign SubscriptStore NameLoad Index Num SubscriptLoad NameLoad Index Num orelse If CompareEq SubscriptLoad NameLoad Index Num Str body Assign SubscriptStore NameLoad Index Num SubscriptLoad NameLoad Index Num If BoolOpAnd CompareIsNot SubscriptLoad NameLoad Index Num NameLoad CompareIsNot SubscriptLoad NameLoad Index Num NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad NameLoad body If Call NameLoad NameLoad body Expr Call NameLoad NameLoad orelse For NameStore NameLoad body Expr Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad For NameStore NameLoad body If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse If Call NameLoad NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse If Call NameLoad NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareGt Call NameLoad NameLoad Num body Assign NameStore Call NameLoad NameLoad keyword NameLoad Return TupleLoad Str NameLoad If CompareGt Call NameLoad NameLoad Num body Assign NameStore Call NameLoad NameLoad keyword NameLoad Return TupleLoad Str NameLoad If CompareGt Call NameLoad NameLoad Num body Assign NameStore Call NameLoad NameLoad keyword NameLoad Return TupleLoad Str NameLoad If CompareGt Call NameLoad NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index Num Return TupleLoad Str NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return BoolOpOr CompareEq NameLoad NameLoad CompareEq BinOpAdd Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq NameLoad Str body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Num If BoolOpAnd CompareNotEq NameLoad Str CompareNotEq NameLoad Str body Return NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad Return Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If BoolOpOr CompareLt Call NameLoad NameLoad Num CompareNotEq SubscriptLoad NameLoad Index Num Str body Return NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num If Call AttributeLoad NameLoad attr NameLoad NameLoad body Return NameLoad orelse Return NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BoolOpAnd Call NameLoad NameLoad NameLoad CompareEq Call NameLoad NameLoad Num CompareEq SubscriptLoad NameLoad Index Num Str Call NameLoad SubscriptLoad NameLoad Index Num NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str NameLoad Return Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Str Str Call NameLoad NameLoad Call NameLoad For NameStore NameLoad body If CompareEq SubscriptLoad NameLoad Index Num Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Num Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad If BoolOpAnd UnaryOpNot SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Str NameLoad orelse If CompareEq SubscriptLoad NameLoad Index Num Str body Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call NameLoad SubscriptLoad NameLoad Index Num orelse If BoolOpAnd CompareEq SubscriptLoad NameLoad Index Num Str CompareEq SubscriptLoad NameLoad Index Num Str body Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str For NameStore NameLoad body Expr Call NameLoad NameLoad NameLoad NameLoad decorator_list Assign NameStore Call NameLoad ListLoad Str Str Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Num For TupleStore NameStore NameStore Call NameLoad NameLoad body If BoolOpAnd CompareGt Call NameLoad NameLoad Num CompareEq SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num body Assign NameStore NameLoad Break If NameLoad body If CompareEq NameLoad Num body Raise Call AttributeLoad NameLoad attr BinOpMod Str SubscriptLoad NameLoad Index Num Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index Num If BoolOpAnd CompareNotEq NameLoad Num CompareNotIn Call AttributeLoad NameLoad attr NameLoad body If CompareEq SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num NameLoad body Pass orelse Raise Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad SubscriptLoad NameLoad Index NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad decorator_list
N/A N/A NginxParser is a member object of the NginxConfigurator class. N/A glob N/A logging N/A os N/A pyparsing N/A re certbot errors certbot_nginx obj certbot_nginx nginxparser N/A logger N/A N/A logging getLogger __name__ NginxParser N/A object N/A N/A Class handles the fine details of parsing the Nginx Configuration.

    :ivar str root: Normalized abosulte path to the server root
        directory. Without trailing slash.
    :ivar dict parsed: Mapping of file paths to parsed trees

     __init__ N/A N/A self root ssl_options N/A N/A N/A N/A self parsed N/A N/A N/A self root N/A N/A N/A os path abspath root N/A N/A self loc N/A N/A self _set_locations ssl_options N/A N/A N/A self load N/A load N/A N/A self N/A N/A N/A Loads Nginx files into a parsed tree.

         N/A N/A self parsed N/A N/A N/A N/A self _parse_recursively N/A N/A self loc N/A root N/A _parse_recursively N/A N/A self filepath N/A N/A N/A Parses nginx config files recursively by looking at 'include'
        directives inside 'http' and 'server' blocks. Note that this only
        reads Nginx files that potentially declare a virtual host.

        :param str filepath: The path to the files to parse, as a glob

         N/A filepath N/A N/A self abs_path filepath N/A trees N/A N/A self _parse_files filepath N/A tree trees N/A N/A entry tree N/A N/A N/A _is_include_directive entry N/A N/A N/A N/A self _parse_recursively N/A entry N/A 1 N/A N/A N/A N/A N/A entry N/A 0 N/A http N/A N/A entry N/A 0 N/A server N/A N/A subentry N/A entry N/A 1 N/A N/A N/A _is_include_directive subentry N/A N/A N/A N/A self _parse_recursively N/A subentry N/A 1 N/A N/A N/A N/A N/A entry N/A 0 N/A http N/A N/A subentry N/A 0 N/A server N/A N/A server_entry N/A subentry N/A 1 N/A N/A N/A _is_include_directive server_entry N/A N/A N/A N/A self _parse_recursively N/A server_entry N/A 1 N/A abs_path N/A N/A self path N/A N/A N/A Converts a relative path to an absolute path relative to the root.
        Does nothing for paths that are already absolute.

        :param str path: The path
        :returns: The absolute path
        :rtype: str

         N/A N/A N/A N/A N/A os path isabs path N/A N/A N/A N/A N/A os path join N/A self root path N/A N/A path N/A get_vhosts N/A N/A self N/A N/A N/A Gets list of all 'virtual hosts' found in Nginx configuration.
        Technically this is a misnomer because Nginx does not have virtual
        hosts, it has 'server blocks'.

        :returns: List of :class:`~certbot_nginx.obj.VirtualHost`
            objects found in configuration
        :rtype: list

         N/A enabled True N/A vhosts N/A N/A servers N/A N/A filename N/A self parsed N/A N/A tree N/A N/A self parsed N/A filename N/A N/A servers N/A filename N/A N/A srv N/A servers N/A filename N/A N/A _do_for_subarray tree N/A N/A N/A x N/A N/A N/A x N/A 0 N/A server N/A N/A N/A x N/A N/A N/A srv append N/A x N/A 1 N/A N/A i server N/A enumerate N/A servers N/A filename N/A N/A new_server N/A N/A self _get_included_directives server N/A N/A N/A servers N/A filename N/A i new_server N/A filename servers N/A N/A server N/A servers N/A filename N/A N/A parsed_server N/A parse_server server N/A vhost N/A N/A obj VirtualHost filename N/A parsed_server N/A addrs N/A parsed_server N/A ssl enabled N/A parsed_server N/A names server N/A N/A N/A vhosts append vhost N/A vhosts N/A _get_included_directives N/A N/A self block N/A N/A N/A Returns array with the "include" directives expanded out by
        concatenating the contents of the included file to the block.

        :param list block:
        :rtype: list

         N/A result N/A list block N/A directive block N/A N/A N/A _is_include_directive directive N/A N/A included_files N/A N/A glob glob N/A N/A self abs_path N/A directive N/A 1 N/A incl included_files N/A N/A N/A N/A N/A N/A result extend N/A N/A self parsed N/A incl N/A N/A N/A KeyError N/A N/A N/A result N/A _parse_files N/A N/A self filepath override N/A False N/A N/A Parse files from a glob

        :param str filepath: Nginx config file path
        :param bool override: Whether to parse a file that has been parsed
        :returns: list of parsed tree structures
        :rtype: list

         N/A files N/A N/A glob glob filepath N/A trees N/A N/A item files N/A N/A N/A N/A item N/A self parsed N/A override N/A N/A N/A N/A N/A N/A open item _file N/A N/A parsed N/A N/A nginxparser load _file N/A N/A N/A self parsed N/A item parsed N/A N/A N/A trees append parsed N/A N/A N/A IOError N/A N/A N/A N/A logger warn Could not open file: %s item N/A N/A N/A pyparsing ParseException N/A N/A N/A N/A logger debug Could not parse file: %s item N/A trees N/A _set_locations N/A N/A self ssl_options N/A N/A N/A Set default location for directives.

        Locations are given as file_paths
        .. todo:: Make sure that files are included

         N/A root N/A N/A self _find_config_root N/A default root N/A nginx_temp N/A N/A N/A os path join N/A self root nginx_ports.conf N/A N/A N/A N/A os path isfile nginx_temp N/A N/A listen nginx_temp N/A name nginx_temp N/A N/A listen default N/A name default N/A N/A root default listen name ssl_options root default listen name ssl_options N/A _find_config_root N/A N/A self N/A N/A N/A Find the Nginx Configuration Root file. N/A location N/A nginx.conf N/A name location N/A N/A N/A N/A N/A os path isfile N/A N/A N/A os path join N/A self root name N/A N/A N/A N/A N/A os path join N/A self root name N/A N/A N/A errors NoInstallationError Could not find configuration root N/A filedump N/A N/A self ext N/A tmp N/A N/A Dumps parsed configurations into files.

        :param str ext: The file extension to use for the dumped files. If
            empty, this overrides the existing conf files.

         N/A filename N/A self parsed N/A N/A tree N/A N/A self parsed N/A filename N/A ext N/A N/A filename N/A N/A filename N/A N/A os path extsep ext N/A N/A N/A N/A N/A logger debug Dumping to %s:
%s filename N/A N/A nginxparser dumps tree N/A N/A open filename w _file N/A N/A N/A N/A nginxparser dump tree _file N/A N/A N/A IOError N/A N/A N/A N/A logger error Could not open file for writing: %s filename N/A _has_server_names N/A N/A self entry names N/A N/A N/A Checks if a server block has the given set of server_names. This
        is the primary way of identifying server blocks in the configurator.
        Returns false if 'entry' doesn't look like a server block at all.

        ..todo :: Doesn't match server blocks whose server_name directives are
        split across multiple conf files.

        :param list entry: The block to search
        :param set names: The names to match
        :rtype: bool

         N/A N/A N/A len names 0 N/A N/A False N/A N/A N/A isinstance entry list N/A N/A False N/A new_entry N/A N/A self _get_included_directives entry N/A server_names N/A set N/A item new_entry N/A N/A N/A N/A isinstance item list N/A N/A False N/A N/A N/A N/A len item 0 N/A N/A item N/A 0 server_name N/A N/A N/A N/A server_names update N/A _get_servernames N/A item N/A 1 N/A N/A server_names names N/A add_server_directives N/A N/A self filename names directives replace N/A N/A N/A Add or replace directives in the first server block with names.

        ..note :: If replace is True, this raises a misconfiguration error
        if the directive does not already exist.
        ..note :: If replace is False nothing gets added if an identical
        block exists already.

        ..todo :: Doesn't match server blocks whose server_name directives are
            split across multiple conf files.

        :param str filename: The absolute filename of the config file
        :param set names: The server_name to match
        :param list directives: The directives to add
        :param bool replace: Whether to only replace existing directives

         N/A N/A N/A N/A _do_for_subarray N/A N/A self parsed N/A filename N/A N/A N/A x N/A N/A N/A self _has_server_names x names N/A N/A N/A x N/A N/A _add_directives x directives replace N/A N/A N/A N/A errors MisconfigurationError N/A err N/A N/A N/A N/A errors MisconfigurationError N/A Problem in %s: %s N/A filename N/A err message N/A add_http_directives N/A N/A self filename directives N/A N/A N/A Adds directives to the first encountered HTTP block in filename.

        We insert new directives at the top of the block to work around
        https://trac.nginx.org/nginx/ticket/810: If the first server block
        doesn't enable OCSP stapling, stapling is broken for all blocks.

        :param str filename: The absolute filename of the config file
        :param list directives: The directives to add

         N/A N/A _do_for_subarray N/A N/A self parsed N/A filename N/A N/A N/A x N/A N/A N/A x N/A 0 N/A http N/A N/A N/A x N/A N/A N/A N/A x N/A 1 insert 0 directives N/A get_all_certs_keys N/A N/A self N/A N/A N/A Gets all certs and keys in the nginx config.

        :returns: list of tuples with form [(cert, key, path)]
            cert - str path to certificate file
            key - str path to associated key file
            path - File path to configuration file.
        :rtype: set

         N/A c_k N/A set N/A vhosts N/A N/A self get_vhosts N/A vhost vhosts N/A N/A tup N/A None None N/A vhost filep N/A N/A vhost ssl N/A N/A directive N/A vhost raw N/A N/A N/A N/A directive N/A 0 ssl_certificate N/A N/A N/A tup N/A 0 N/A directive N/A 1 N/A N/A N/A N/A directive N/A 0 ssl_certificate_key N/A N/A N/A tup N/A 1 N/A directive N/A 1 N/A N/A N/A N/A tup N/A 0 None N/A N/A tup N/A 1 None N/A N/A N/A N/A c_k add N/A tuple tup N/A c_k N/A N/A _do_for_subarray N/A N/A entry condition func N/A N/A N/A Executes a function for a subarray of a nested array if it matches
    the given condition.

    :param list entry: The list to iterate over
    :param function condition: Returns true iff func should be executed on item
    :param function func: The function to call for each matching item

     N/A N/A isinstance entry list N/A N/A N/A condition entry N/A N/A N/A func entry N/A N/A item entry N/A N/A N/A _do_for_subarray item condition func N/A get_best_match N/A N/A target_name names N/A N/A N/A Finds the best match for target_name out of names using the Nginx
    name-matching rules (exact > longest wildcard starting with * >
    longest wildcard ending with * > regex).

    :param str target_name: The name to match
    :param set names: The candidate server names
    :returns: Tuple of (type of match, the name that matched)
    :rtype: tuple

     N/A exact N/A N/A wildcard_start N/A N/A wildcard_end N/A N/A regex N/A N/A name names N/A N/A N/A _exact_match target_name name N/A N/A N/A N/A exact append name N/A N/A N/A _wildcard_match target_name name True N/A N/A N/A N/A wildcard_start append name N/A N/A N/A _wildcard_match target_name name False N/A N/A N/A N/A wildcard_end append name N/A N/A N/A _regex_match target_name name N/A N/A N/A N/A regex append name N/A N/A N/A len exact 0 N/A N/A match N/A min exact key len N/A N/A exact match N/A N/A N/A len wildcard_start 0 N/A N/A match N/A max wildcard_start key len N/A N/A wildcard_start match N/A N/A N/A len wildcard_end 0 N/A N/A match N/A max wildcard_end key len N/A N/A wildcard_end match N/A N/A N/A len regex 0 N/A N/A match N/A regex N/A 0 N/A N/A regex match N/A N/A None None N/A _exact_match N/A N/A target_name name N/A N/A N/A N/A N/A target_name name N/A N/A . target_name name N/A _wildcard_match N/A N/A target_name name start N/A N/A N/A N/A name * N/A N/A True N/A parts N/A N/A target_name split . N/A match_parts N/A N/A name split . N/A N/A start N/A N/A N/A N/A parts reverse N/A N/A N/A match_parts reverse N/A first N/A N/A match_parts pop 0 N/A N/A N/A first * N/A first N/A N/A False N/A target_name N/A N/A . join parts N/A name N/A N/A . join match_parts N/A N/A N/A target_name endswith N/A . name N/A _regex_match N/A N/A target_name name N/A N/A N/A N/A N/A N/A len name 2 N/A N/A name N/A 0 ~ N/A N/A False N/A N/A N/A regex N/A N/A re compile N/A name N/A 1 N/A N/A N/A re match regex target_name N/A N/A True N/A N/A False N/A N/A N/A N/A re error N/A N/A False N/A _is_include_directive N/A N/A entry N/A N/A N/A Checks if an nginx parsed entry is an 'include' directive.

    :param list entry: the parsed entry
    :returns: Whether it's an 'include' directive
    :rtype: bool

     N/A N/A N/A isinstance entry list N/A N/A len entry 2 N/A N/A entry N/A 0 include N/A isinstance N/A entry N/A 1 str N/A _get_servernames N/A N/A names N/A N/A N/A Turns a server_name string into a list of server names

    :param str names: server names
    :rtype: list

     N/A whitespace_re N/A N/A re compile \s+ N/A names N/A N/A re sub whitespace_re names N/A N/A N/A names split N/A parse_server N/A N/A server N/A N/A N/A Parses a list of server directives.

    :param list server: list of directives in a server block
    :rtype: dict

     N/A parsed_server N/A addrs ssl names N/A set False N/A set N/A directive server N/A N/A N/A N/A directive N/A 0 listen N/A N/A addr N/A N/A N/A obj Addr fromstring N/A directive N/A 1 N/A N/A N/A N/A parsed_server N/A addrs add addr N/A N/A N/A N/A parsed_server N/A ssl N/A addr ssl N/A N/A N/A parsed_server N/A ssl True N/A N/A N/A N/A directive N/A 0 server_name N/A N/A N/A N/A N/A parsed_server N/A names update N/A _get_servernames N/A directive N/A 1 N/A N/A N/A N/A N/A directive N/A 0 ssl N/A N/A directive N/A 1 on N/A N/A N/A parsed_server N/A ssl True N/A parsed_server N/A _add_directives N/A N/A block directives replace N/A N/A N/A Adds or replaces directives in a config block.

    When replace=False, it's an error to try and add a directive that already
    exists in the config block with a conflicting value.

    When replace=True, a directive with the same name MUST already exist in the
    config block, and the first instance will be replaced.

    ..todo :: Find directives that are in included files.

    :param list block: The block to replace in
    :param list directives: The new directives.

     N/A directive directives N/A N/A N/A _add_directive block directive replace N/A N/A repeatable_directives N/A set N/A server_name listen include _add_directive N/A N/A block directive replace N/A N/A N/A Adds or replaces a single directive in a config block.

    See _add_directives for more documentation.

     N/A location -1 N/A N/A index line N/A enumerate block N/A N/A N/A N/A N/A len line 0 N/A N/A line N/A 0 N/A directive N/A 0 N/A N/A location index N/A N/A replace N/A N/A N/A location -1 N/A N/A N/A N/A errors MisconfigurationError N/A expected directive for %s in the Nginx config but did not find it. N/A directive N/A 0 N/A N/A block N/A location directive N/A N/A directive_name N/A directive N/A 0 N/A directive_value N/A directive N/A 1 N/A N/A N/A location -1 N/A N/A N/A directive_name __str__ repeatable_directives N/A N/A N/A N/A N/A block N/A location N/A 1 directive_value N/A N/A N/A N/A N/A N/A errors MisconfigurationError N/A tried to insert directive "%s" but found conflicting "%s". N/A directive N/A block N/A location N/A N/A N/A N/A block append directive N/A