コード例 #1
0
ファイル: interface.py プロジェクト: mmenguala/nav-debian
    def get_linkstate_filter(self):
        from nav.ipdevpoll.config import ipdevpoll_conf as conf
        default = 'topology'
        link_filter = (conf.get('linkstate', 'filter') if conf.has_option(
            'linkstate', 'filter') else default)

        if link_filter not in ('any', 'topology'):
            self._logger.warning(
                "configured linkstate filter is invalid: %r"
                " (using %r as default)", link_filter, default)
            return default
        else:
            return link_filter
コード例 #2
0
ファイル: interface.py プロジェクト: alexanderfefelov/nav
    def get_linkstate_filter(self):
        from nav.ipdevpoll.config import ipdevpoll_conf as conf
        default = 'topology'
        link_filter = (conf.get('linkstate', 'filter')
                       if conf.has_option('linkstate', 'filter')
                       else default)

        if link_filter not in ('any', 'topology'):
            self._logger.warning("configured linkstate filter is invalid: %r"
                                 " (using %r as default)", link_filter, default)
            return default
        else:
            return link_filter