Debian Codegraph @

lib/jnpr/junos/ofacts/switch_style.py

raw
1 import re
2
3
4 def facts_switch_style(junos, facts):
5 persona = facts["personality"]
6
7 if persona in ["MX", "SRX_HIGHEND"]:
8 style = "BRIDGE_DOMAIN"
9 elif persona in ["SWITCH", "SRX_BRANCH"]:
10 model = facts["model"]
11 if re.match("firefly", model, re.IGNORECASE):
12 style = "NONE"
13 elif re.match("^(EX9)|(EX43)", model):
14 style = "VLAN_L2NG"
15 else:
16 style = "VLAN"
17 else:
18 style = "NONE"
19
20 facts["switch_style"] = style