Skip to content

Commit

Permalink
Add docker teamd support (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuotian Cheng authored Dec 18, 2016
1 parent 9a7b0ba commit 10fe16b
Show file tree
Hide file tree
Showing 10 changed files with 1,018 additions and 8 deletions.
1 change: 1 addition & 0 deletions ansible/group_vars/sonic_latest/package_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ image_id_orchagent_cavm: docker-orchagent-cavm:latest
image_id_fpm: docker-fpm:latest
image_id_snmp_sv2: docker-snmp-sv2:latest
image_id_lldp_sv2: docker-lldp-sv2:latest
image_id_teamd: docker-teamd:latest
1 change: 1 addition & 0 deletions ansible/inventory
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[sonic_latest]
switch1 ansible_host=10.0.0.100 sonic_version=v2 sonic_hwsku=ACS-S6000
switch2 ansible_host=10.0.0.101 sonic_version=v2 sonic_hwsku=ACS-MSN2700
switch3 ansible_host=10.0.0.102 sonic_version=v2 sonic_hwsku=ACS-S6000 # LAG topo: 8 LAGs x 2 members/lag to spines; 16 ports to Tors

[sonic:children]
sonic_latest
Expand Down
12 changes: 6 additions & 6 deletions ansible/library/minigraph_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def parse_dpg(dpg, hname):
pcintfname = pcintf.find(str(QName(ns, "Name"))).text
pcintfmbr = pcintf.find(str(QName(ns, "AttachTo"))).text
mbr_list = pcintfmbr.split(';', 1)
pc_intfs.append({'name': pcintfname.lower(), 'members': mbr_list})
pc_intfs.append({'name': pcintfname, 'members': mbr_list})

lointfs = child.find(str(QName(ns, "LoopbackIPInterfaces")))
lo_intfs = []
Expand Down Expand Up @@ -369,6 +369,11 @@ def parse_xml(filename, hostname):
elif child.tag == str(QName(ns, "UngDec")):
(u_neighbors, u_devices, _, _, _, _) = parse_png(child, hostname)

# Replace port with alias in port channel interfaces members
for pc in pc_intfs:
for i,member in enumerate(pc['members']):
pc['members'][i] = port_alias_map[member]

Tree = lambda: defaultdict(Tree)

results = Tree()
Expand Down Expand Up @@ -399,7 +404,6 @@ def parse_xml(filename, hostname):

port_alias_map = {}


def main():
module = AnsibleModule(
argument_spec=dict(
Expand Down Expand Up @@ -441,13 +445,9 @@ def main():
def print_parse_xml(hostname):
filename = '../minigraph/' + hostname + '.xml'
results = parse_xml(filename, hostname)
import json
print(json.dumps(results, indent=3, cls=minigraph_encoder))


from ansible.module_utils.basic import *

if __name__ == "__main__":
main()
#debug_main()

Loading

0 comments on commit 10fe16b

Please sign in to comment.