[config/main.py]: Inform user to enable sflow feature with 'config sflow enable'. #1704
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.