Skip to content
Merged
Show file tree
Hide file tree
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: 5 additions & 2 deletions scripts/teamshow
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"""

import json
import os
import re
import swsssdk
import subprocess
Expand Down Expand Up @@ -127,15 +128,17 @@ class Teamshow(object):
print tabulate(output, header)

def main():
if os.geteuid() != 0:
exit("This utility must be run as root")

try:
team = Teamshow()
team.get_portchannel_names()
team.get_teamdctl()
team.get_teamshow_result()
team.display_summary()
except Exception as e:
print e.message
sys.exit(1)
sys.exit(e.message)

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def rif(interface, period, verbose):
@click.option('--verbose', is_flag=True, help="Enable verbose output")
def portchannel(verbose):
"""Show PortChannel information"""
cmd = "teamshow"
cmd = "sudo teamshow"
run_command(cmd, display_cmd=verbose)

#
Expand Down