From 3617f9af978b293e36395e24fe52182eb47d7189 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Mon, 29 Oct 2012 23:27:57 -0700 Subject: [PATCH] Re-discover targets --- iscsi-client/iscsi-client-lib.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iscsi-client/iscsi-client-lib.pl b/iscsi-client/iscsi-client-lib.pl index 95cec0fc9..6a992226f 100644 --- a/iscsi-client/iscsi-client-lib.pl +++ b/iscsi-client/iscsi-client-lib.pl @@ -211,6 +211,10 @@ return \@rv; sub create_iscsi_connection { my ($host, $port, $iface, $target, $method, $user, $pass) = @_; + +# Re-discover targets, so that this function works when called remotely +&list_iscsi_targets($host, $port, $iface); + my $cmd = "$config{'iscsiadm'} -m node". ($target ? " -T ".quotemeta($target->{'name'}).":". quotemeta($target->{'target'}) : "").