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

[consutil][show] Remove root need from show line command #1218

Merged
merged 1 commit into from
Nov 5, 2020

Conversation

Blueve
Copy link
Contributor

@Blueve Blueve commented Nov 5, 2020

- What I did

Remove root privilege need for consutil show and show line command.

As discuss in this thread (sonic-net/sonic-buildimage#5438), I am going to remove unnecessary root privilege need from console commands.

- How I did it

  • Simply remove the check
  • Add unit test for consutil show command
  • Fix a known typo (found by adding unittest)

- How to verify it

Build py-wheel package and install+test on a physical SONiC DUT

- Previous command output (if the output of a command-line utility has changed)

admin@sonic:~$ show line
Root privileges are required for this operation

- New command output (if the output of a command-line utility has changed)

admin@sonic:~$ show line
  Line    Baud    PID    Start Time    Device
------  ------  -----  ------------  --------
     0       -      -             -
     1    9600      -             -   switch1
     2       -      -             -
     3       -      -             -
     4       -      -             -
     5       -      -             -
     6       -      -             -
     7       -      -             -
     8       -      -             -
     9       -      -             -
    10       -      -             -
    11       -      -             -
    12       -      -             -
    13       -      -             -
    14       -      -             -
    15       -      -             -
    16       -      -             -
    17       -      -             -
    18       -      -             -
    19       -      -             -
    20       -      -             -
    21       -      -             -
    22       -      -             -
    23       -      -             -
    24       -      -             -
    25       -      -             -
    26       -      -             -
    27       -      -             -
    28       -      -             -
    29       -      -             -
    30       -      -             -
    31       -      -             -
    32       -      -             -
    33       -      -             -
    34       -      -             -
    35       -      -             -
    36       -      -             -
    37       -      -             -
    38       -      -             -
    39       -      -             -
    40       -      -             -
    41       -      -             -
    42       -      -             -
    43       -      -             -
    44       -      -             -
    45       -      -             -
    46       -      -             -
    47       -      -             -

@Blueve Blueve requested a review from yxieca November 5, 2020 06:16
@@ -73,6 +74,10 @@ def clear(db, target, devicename):
@click.option('--devicename', '-d', is_flag=True, help="connect by name - if flag is set, interpret linenum as device name instead")
def connect(db, target, devicename):
"""Connect to switch via console device - TARGET is line number or device name of switch"""
if os.geteuid() != 0:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will raise another PR to remove this because we need a udev rule update in sonic-buildimage before doing that.

@Blueve Blueve merged commit 97dec12 into sonic-net:master Nov 5, 2020
@Blueve Blueve deleted the dev/jika/showut branch November 5, 2020 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants