Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Teamshow]: get platform info before parsing minigraph #30

Merged
merged 3 commits into from
Apr 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion scripts/teamshow
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import subprocess
import sys
from tabulate import tabulate
from minigraph import parse_xml
from sonic_platform import get_machine_info
from sonic_platform import get_platform_info

class Teamshow(object):
def __init__(self):
Expand All @@ -36,7 +38,10 @@ class Teamshow(object):
Get the portchannel names from minigraph.
"""
minigraph_path = '/etc/sonic/minigraph.xml'
self.teams = parse_xml(minigraph_path)['minigraph_portchannels'].keys();
machine_info = get_machine_info()
platform_info = get_platform_info(machine_info)

self.teams = parse_xml(minigraph_path, platform = platform_info)['minigraph_portchannels'].keys();

def get_team_id(self, team):
"""
Expand Down