Skip to content

Commit

Permalink
make portstat, teamshow, aclshow runnable by normal user (sonic-net#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
lguohan committed May 10, 2017
1 parent 7f44592 commit ad735d1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/aclshow
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class AclStat(object):
self.table_list = tables.split(",")

# Set up db connections
self.db = swsssdk.SonicV2Connector()
self.db = swsssdk.SonicV2Connector(host="127.0.0.1")
self.db.connect(self.db.APPL_DB)
self.db.connect(self.db.COUNTERS_DB)

Expand Down
5 changes: 1 addition & 4 deletions scripts/portstat
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ PORT_STATUS_FIELD = "oper_status"

class Portstat(object):
def __init__(self):
self.db = swsssdk.SonicV2Connector()
self.db = swsssdk.SonicV2Connector(host='127.0.0.1')
self.db.connect(self.db.COUNTERS_DB)
self.db.connect(self.db.APPL_DB)

Expand Down Expand Up @@ -346,9 +346,6 @@ Examples:
wait_time_in_seconds = args.period
print_all = args.all

if not os.geteuid() == 0:
raise RuntimeError("must be root to run")

if tag_name is not None:
cnstat_file = uid + "-" + tag_name
else:
Expand Down
2 changes: 1 addition & 1 deletion scripts/teamshow
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Teamshow(object):
self.summary = {}
self.err = None
# setup db connection
self.db = swsssdk.SonicV2Connector()
self.db = swsssdk.SonicV2Connector(host="127.0.0.1")
self.db.connect(self.db.APPL_DB)

def get_portchannel_names(self):
Expand Down

0 comments on commit ad735d1

Please sign in to comment.