Skip to content

make portstat runnable by normal user #47

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

Merged
merged 2 commits into from
May 10, 2017
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
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