def build_ospf(self, router, cfg=None): if not cfg: cfg = ConfigDict() if not cfg.redistribute: cfg.redistribute = ConfigDict() if not cfg.interfaces: cfg.interfaces = [] if not cfg.networks: cfg.networks = [] return cfg