From ba60053e94147f401efd298fe1bd4d38cf9f34f7 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 2 Jun 2009 14:22:15 -0700 Subject: Change API for login modules The login modules aren't really objects (if Perl really had objects), so just use dynamic invoke of update routine. (cherry picked from commit 37ba59896d4c9ac5c914d1901d86ed7e7d844871) --- scripts/system/vyatta_update_login.pl | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'scripts/system') diff --git a/scripts/system/vyatta_update_login.pl b/scripts/system/vyatta_update_login.pl index b854427b..94e88ed1 100644 --- a/scripts/system/vyatta_update_login.pl +++ b/scripts/system/vyatta_update_login.pl @@ -30,13 +30,10 @@ foreach my $type ($config->listNodes()) { my $kind = ucfirst $type; $kind =~ s/-server/Server/; - my $location = "Vyatta/Login/$kind.pm"; - my $class = "Vyatta::Login::$kind"; - - require $location; + # Dynamically load the module to handle that login method + require "Vyatta/Login/$kind.pm"; - my $obj = $class->new(); - die "Don't understand $type" unless $obj; - - $obj->update(); + # Dynamically invoke update for this type + my $login = "Vyatta::Login::$kind"; + $login->update(); } -- cgit v1.2.3