Skip to content

Commit

Permalink
[cfggen] Allow sku with no alias mapping and minigraph with no png
Browse files Browse the repository at this point in the history
  • Loading branch information
taoyl-ms committed Feb 24, 2017
1 parent a16c780 commit e4319eb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/sonic-config-engine/minigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,17 @@ def parse_xml(filename, platform=None):
# Replace port with alias in Vlan interfaces members
for vlan in vlan_intfs:
for i,member in enumerate(vlan['members']):
vlan['members'][i] = port_alias_map[member]
if port_alias_map.has_key(member):
vlan['members'][i] = port_alias_map[member]

# Convert vlan members into a space-delimited string
vlan['members'] = " ".join(vlan['members'])

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

Tree = lambda: defaultdict(Tree)

Expand All @@ -385,15 +387,15 @@ def parse_xml(filename, platform=None):
results['minigraph_underlay_neighbors'] = u_neighbors
results['minigraph_underlay_devices'] = u_devices
results['minigraph_as_xml'] = mini_graph_path
results['minigraph_console'] = get_console_info(devices, console_dev, console_port)
results['minigraph_mgmt'] = get_mgmt_info(devices, mgmt_dev, mgmt_port)
if devices != None:
results['minigraph_console'] = get_console_info(devices, console_dev, console_port)
results['minigraph_mgmt'] = get_mgmt_info(devices, mgmt_dev, mgmt_port)
results['minigraph_hostname'] = hostname
results['inventory_hostname'] = hostname
results['alias_map'] = alias_map_list

return results


port_alias_map = {}


Expand Down

0 comments on commit e4319eb

Please sign in to comment.