Skip to content

Login messages config#2

Closed
fastiuk wants to merge 3 commits intomasterfrom
login-message-config
Closed

Login messages config#2
fastiuk wants to merge 3 commits intomasterfrom
login-message-config

Conversation

@fastiuk
Copy link
Owner

@fastiuk fastiuk commented Jul 1, 2022

This PR depends on fastiuk/sonic-buildimage#4

Why I did it

  • Add an ability to configure login messages: /etc/motd, /etc/issue*
  • Be able to use table defines from swsscommon

How to verify it

Build SONiC
or
When SONiC was already built:

rm -f target/python-wheels/bullseye/sonic_yang_models-1.0-py3-none-any.whl
BLDENV=bullseye make -f Makefile.work target/python-wheels/bullseye/sonic_yang_models-1.0-py3-none-any.whl
rm -f target/python-wheels/bullseye/sonic_host_services-1.0-py3-none-any.whl
BLDENV=bullseye make -f Makefile.work target/python-wheels/bullseye/sonic_host_services-1.0-py3-none-any.whl

Login into the switch.
Set messages:

redis-cli -n 4 HSET "LOGIN_MESSAGE|pre_login" "message" "Test pre login"
redis-cli -n 4 HSET "LOGIN_MESSAGE|post_login" "message" "Test post login"

Logout/login and see the results:
Screenshot 2022-07-02 at 22 58 11
Clear messages:

redis-cli -n 4 HSET "LOGIN_MESSAGE|pre_login" "message" ""
redis-cli -n 4 HSET "LOGIN_MESSAGE|post_login" "message" ""

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

  • Add an ability to configure pre-login and post-login messages: /etc/motd, /etc/issue*

Link to config_db schema for YANG module changes

sonic-login_message.yang

Superproject PR:

PR title State
Login messages config GitHub issue/pull request detail

A picture of a cute animal

1-46

@fastiuk fastiuk changed the title Login message config Login messages config Jul 2, 2022
@fastiuk
Copy link
Owner Author

fastiuk commented Jul 2, 2022

@stepanblyschak please review

fastiuk added 3 commits July 30, 2022 17:17
Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
* Add EEPROM_INFO table
* Add FAN_INFO table
* Add TEMPERATURE_INFO table
* Add PSU_INFO table

Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
@fastiuk fastiuk force-pushed the login-message-config branch from 83ccd09 to 4dcb074 Compare July 30, 2022 14:23
@stepanblyschak
Copy link

@fastiuk Please update PR to include only your changes

@fastiuk fastiuk changed the base branch from master to 202111 October 25, 2022 09:50
@fastiuk fastiuk changed the base branch from 202111 to master October 25, 2022 09:50
@fastiuk
Copy link
Owner Author

fastiuk commented Oct 25, 2022

Please update PR to include only your changes

Done

Comment on lines +475 to +478
#define STATE_EEPROM_INFO_TABLE_NAME "EEPROM_INFO"
#define STATE_FAN_INFO_TABLE_NAME "FAN_INFO"
#define STATE_TEMPERATURE_INFO_TABLE_NAME "TEMPERATURE_INFO"
#define STATE_PSU_INFO_TABLE_NAME "PSU_INFO"

Choose a reason for hiding this comment

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

These lines are not related to log message config

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yes, it doesn't.
That is why I put it in a separate commit.

#define CFG_LAG_INTF_TABLE_NAME "PORTCHANNEL_INTERFACE"
#define CFG_VLAN_INTF_TABLE_NAME "VLAN_INTERFACE"
#define CFG_VLAN_SUB_INTF_TABLE_NAME "VLAN_SUB_INTERFACE"
#define CFG_MGMT_PORT_TABLE_NAME "MGMT_PORT"

Choose a reason for hiding this comment

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

This line is not related to log message config

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yes, it doesn't.
That is why I put it in a separate commit.

Choose a reason for hiding this comment

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

The PR title is "Login messages config". SONiC community requires to divide different features contribution into different PRs.

@fastiuk fastiuk closed this May 17, 2023
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