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

make portstat runnable by normal user #47

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