diff options
author | Maarten Vanraes <alien@mageia.org> | 2016-08-06 13:44:42 +0200 |
---|---|---|
committer | Maarten Vanraes <alien@mageia.org> | 2016-08-06 13:44:42 +0200 |
commit | f9f5271a4477f573b04ba5092dd09843f3c73ec9 (patch) | |
tree | 968c328b6e5dcaefcab6773b1a9eb2bb0ca70463 /lib | |
parent | be11afaf5b9090620030f681dc9bb38298c49895 (diff) | |
download | manatools-f9f5271a4477f573b04ba5092dd09843f3c73ec9.tar manatools-f9f5271a4477f573b04ba5092dd09843f3c73ec9.tar.gz manatools-f9f5271a4477f573b04ba5092dd09843f3c73ec9.tar.bz2 manatools-f9f5271a4477f573b04ba5092dd09843f3c73ec9.tar.xz manatools-f9f5271a4477f573b04ba5092dd09843f3c73ec9.zip |
disk_backend: find a specific plugin
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ManaTools/Shared/disk_backend.pm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/ManaTools/Shared/disk_backend.pm b/lib/ManaTools/Shared/disk_backend.pm index 199f76af..5be11fc9 100644 --- a/lib/ManaTools/Shared/disk_backend.pm +++ b/lib/ManaTools/Shared/disk_backend.pm @@ -589,6 +589,36 @@ sub walkplugins { #============================================================= +=head2 findplugin + +=head3 INPUT + + $name: Str + ... + +=head3 OUTPUT + + a Plugin or undef + +=head3 DESCRIPTION + + this method will return the first matching Plugin + +=cut + +#============================================================= +sub findplugin { + my $self = shift; + my $name = shift; + my $plugins = $self->plugins; + for my $plugin (@{$plugins}) { + return $plugin if ($plugin->isa('ManaTools::Shared::disk_backend::Plugin::'. $name)); + } + return undef; +} + +#============================================================= + =head2 findpartprop =head3 OUTPUT |