From d93377028f37ed5f72c3daa4e16b2fc011eb1b3a Mon Sep 17 00:00:00 2001 From: Azmy Ali Date: Tue, 7 May 2024 08:24:28 +0300 Subject: [PATCH] Add base class implementation for local users' passwords reset --- .../local_users_passwords_reset_base.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sonic_platform_base/local_users_passwords_reset_base.py diff --git a/sonic_platform_base/local_users_passwords_reset_base.py b/sonic_platform_base/local_users_passwords_reset_base.py new file mode 100644 index 000000000..460c0f9e6 --- /dev/null +++ b/sonic_platform_base/local_users_passwords_reset_base.py @@ -0,0 +1,25 @@ +''' + local_users_passwords_reset_base.py + + Abstract base class for implementing platform-specific + local users' passwords reset base functionality for SONiC +''' + + +class LocalUsersConfigurationResetBase(object): + """ + Abstract base class for resetting local users' passwords on the switch + """ + def should_trigger(self): + ''' + define the condition to trigger + ''' + # the condition to trigger start() method, the default implementation will be by checking if a long reboot press was detected. + raise NotImplementedError + + def start(self): + ''' + define the functionality + ''' + # the implementation of deleting non-default users and restoring original passwords for default users and expiring them + raise NotImplementedError