lib/jnpr/junos/cfg/phyport/__init__.py
raw| 1 | from jnpr.junos.cfg import Resource |
| 2 | from jnpr.junos.cfg.phyport.classic import PhyPortClassic |
| 3 | from jnpr.junos.cfg.phyport.switch import PhyPortSwitch |
| 4 | |
| 5 | __all__ = ["PhyPort"] |
| 6 | |
| 7 | |
| 8 | class PhyPort(object): |
| 9 | def __new__(cls, dev, name=None): |
| 10 | supercls = { |
| 11 | "CLASSIC": PhyPortClassic, |
| 12 | "SWITCH": PhyPortSwitch, |
| 13 | }.get(dev.facts["ifd_style"]) |
| 14 | newcls = type(cls.__name__, (supercls,), {}) |
| 15 | return newcls(dev, name) |