]> git.etc.gen.nz Git - app-bcvi-autoinstall.git/commitdiff
Check to make sure that InstallManager.pm has loaded before using functions from it.
authorAndrew Ruthven <andrew@etc.gen.nz>
Tue, 7 Sep 2010 00:49:53 +0000 (12:49 +1200)
committerAndrew Ruthven <andrew@etc.gen.nz>
Tue, 7 Sep 2010 00:49:53 +0000 (12:49 +1200)
lib/App/BCVI/AutoInstall.pm

index 630a8c06a2d37e5b4b7e976dfef51389f4ad0933..6740ea8c255a974ff7c674a9ff33a8a9c7493f4b 100644 (file)
@@ -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);
 }