diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-06-02 14:22:15 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-06-02 15:14:08 -0700 |
commit | 37ba59896d4c9ac5c914d1901d86ed7e7d844871 (patch) | |
tree | e7f5a3041366b5695eb8db10c06ceb4e542f9dc6 /scripts/system/vyatta_update_login.pl | |
parent | bf86040fef55fdb644b3670a9e1ec093e67df828 (diff) | |
download | vyatta-cfg-system-37ba59896d4c9ac5c914d1901d86ed7e7d844871.tar.gz vyatta-cfg-system-37ba59896d4c9ac5c914d1901d86ed7e7d844871.zip |
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.
Diffstat (limited to 'scripts/system/vyatta_update_login.pl')
-rw-r--r-- | scripts/system/vyatta_update_login.pl | 13 |
1 files changed, 5 insertions, 8 deletions
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(); } |