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

[config/main.py]: Inform user to enable sflow feature with 'config sflow enable'. #1704

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

praveen-li
Copy link
Member

@praveen-li praveen-li commented Jul 1, 2021

Inform user to enable sflow feature with 'config sflow enable', if disabled.

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com

What I did

We add sflow service as masked to start with in build_scripts/mask_disabled_services.py. So sysctmctl enable will not work directly. Service is unmasked when user runs config feature command for sflow. So it is better to inform user that the feature sflow is disabled, when user runs the command 'config sflow enable'.

How I did it

Inform user to enable sflow feature with 'config sflow enable' if disabled.

How to verify it

Before fix:

admin@asw04:~$ sudo config sflow enable
Failed to enable unit: Unit file /etc/systemd/system/sflow.service is masked.

After fix:

admin@lnos-x1-a-asw04:~$ sudo config sflow enable
sflow feature is not enabled. Enable sflow using 'config feature' command first.

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

Output is changed when below command runs first time.
admin@asw04:/usr/lib/systemd/system$ sudo config sflow enable

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

admin@lnos-x1-a-asw04:~$ sudo config sflow enable
sflow feature is not enabled. Enable sflow using 'config feature' command first.

Signed-off-by: Praveen Chaudhary <pchaudhary@linkedin.com>
@praveen-li
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 1704 in repo Azure/sonic-utilities

config/main.py Outdated Show resolved Hide resolved
@praveen-li praveen-li changed the title [config/main.py]: Unmask sflow service if masked. [config/main.py]: Inform user to enable sflow feature with 'config sflow enable'. Jul 15, 2021
Praveen Chaudhary added 2 commits July 14, 2021 21:22
@praveen-li
Copy link
Member Author

@lguohan Fixed test as well, looks good now.
@jleveque for review

@praveen-li
Copy link
Member Author

@lguohan Fixed test as well, looks good now.
@jleveque for review

Gentle reminder, I think it is a useful enhancement.

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