From: Andrew Ruthven Date: Tue, 7 Sep 2010 00:49:53 +0000 (+1200) Subject: Check to make sure that InstallManager.pm has loaded before using functions from it. X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d316ef7550ae90a9a56552bf25edce7aa4d5cf05;p=app-bcvi-autoinstall.git Check to make sure that InstallManager.pm has loaded before using functions from it. --- diff --git a/lib/App/BCVI/AutoInstall.pm b/lib/App/BCVI/AutoInstall.pm index 630a8c0..6740ea8 100644 --- a/lib/App/BCVI/AutoInstall.pm +++ b/lib/App/BCVI/AutoInstall.pm @@ -3,16 +3,18 @@ package App::BCVI::AutoInstall; use warnings; use strict; -use App::BCVI::InstallManager; - our $VERSION = '0.1'; sub execute_wrapped_ssh { my ($self, $target, @args) = @_; - my $sig = $self->get_install_signature($target); - if (! defined $sig) { - $self->install_to_host($target); + if ($self->can("get_install_signature")) { + my $sig = $self->get_install_signature($target); + if (! defined $sig) { + $self->install_to_host($target); + } + } else { + warn "App::BCVI::AutoInstall can only function if App::BCVI::InstallManager is installed.\n"; } $self->SUPER::execute_wrapped_ssh($target, @args); }