From d316ef7550ae90a9a56552bf25edce7aa4d5cf05 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Tue, 7 Sep 2010 12:49:53 +1200 Subject: [PATCH] Check to make sure that InstallManager.pm has loaded before using functions from it. --- lib/App/BCVI/AutoInstall.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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); } -- 2.30.2