Skip to content

Updating Interface Tagged VLANs in a Script #18233

Closed Answered by aascedu
aascedu asked this question in Help Wanted!
Discussion options

You must be logged in to vote

Answer :

vlan_group = VLANGroup.objects.get(custom_field_data={"PrsID": response_data[0]['EnregTerID']})
vlan_name = "ID" + vlan_id + "-P" + PrsID_fibre 
vlan = VLAN.objects.create(name=vlan_name, vid=int(vlan_id), group=vlan_group)
# self.log_info(f"PrsID_fibre: {PrsID_fibre}, PrsID_Porte de collecte: {response_data[0]['EnregTerID']}, interface: {interface}")
PrsID_switch = int((data['conf'].name.split('-')[0])[1:])
if interface.split('-')[1][0] == "0":
	switch = VirtualChassis.objects.get(custom_field_data={'PrsID': PrsID_switch}).members.get(vc_position=1)
else:
	switch = VirtualChassis.objects.get(custom_field_data={'PrsID': PrsID_switch}).members.get(vc_position=2)
interface_switch = s…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by aascedu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant