コード例 #1
0
ファイル: iniparser.py プロジェクト: yadneshk/insights-core
    def apply_defaults(cfg):
        if "DEFAULT" not in cfg:
            return cfg

        defaults = cfg["DEFAULT"]
        not_defaults = cfg[~eq("DEFAULT")]
        for c in not_defaults:
            for d in defaults.grandchildren:
                if d.name not in c:
                    c.children.append(d)

        cfg.children = list(not_defaults)
        return cfg
コード例 #2
0
    def _desugar_match_ignore(self, match, ignore):
        if match is None:
            match = TRUE
        elif isinstance(match, str):
            if match in self:
                match = eq(dr.get_name(self[match]))
            else:
                match = matches(match)

        if ignore is None:
            ignore = FALSE
        elif isinstance(ignore, str):
            ignore = matches(ignore)

        return (match, ignore)
コード例 #3
0
ファイル: nginx_conf.py プロジェクト: yadneshk/insights-core
 def __init__(self, confs):
     super(NginxConfTree, self).__init__(confs, "nginx.conf", eq("include"))
コード例 #4
0
 def __init__(self, confs):
     include = eq("include")
     main_file = "logrotate.conf"
     super(LogRotateConfTree, self).__init__(confs, main_file, include)
コード例 #5
0
 def __init__(self, confs):
     include = eq("conf-dir")
     main_file = "dnsmasq.conf"
     super(DnsmasqConfTree, self).__init__(confs, main_file, include)