@@ -4700,6 +4700,16 @@ private void cleanupTemplateSR(Connection conn) {
47004700 }
47014701 }
47024702
4703+ protected boolean launchHeartBeat (Connection conn ) {
4704+ String result = callHostPluginPremium (conn , "heartbeat" , "host" , _host .uuid , "interval" , Integer
4705+ .toString (_heartbeatInterval ));
4706+ if (result == null || !result .contains ("> DONE <" )) {
4707+ s_logger .warn ("Unable to launch the heartbeat process on " + _host .ip );
4708+ return false ;
4709+ }
4710+ return true ;
4711+ }
4712+
47034713 protected SetupAnswer execute (SetupCommand cmd ) {
47044714 Connection conn = getConnection ();
47054715 setupServer (conn );
@@ -4720,9 +4730,9 @@ protected SetupAnswer execute(SetupCommand cmd) {
47204730
47214731 }
47224732
4723- String result = callHostPluginPremium ( conn , "heartbeat" , "host" , _host . uuid , "interval" , Integer . toString ( _heartbeatInterval ));
4724- if ( result == null || ! result . contains ( "> DONE <" )) {
4725- s_logger . warn ( "Unable to launch the heartbeat process on " + _host . ip );
4733+
4734+ boolean r = launchHeartBeat ( conn );
4735+ if (! r ) {
47264736 return null ;
47274737 }
47284738 cleanupTemplateSR (conn );
@@ -4737,8 +4747,10 @@ protected SetupAnswer execute(SetupCommand cmd) {
47374747 } catch (Types .MapDuplicateKey e ) {
47384748 s_logger .debug ("multipath is already set" );
47394749 }
4740- if (cmd .needSetup ()) {
4741- result = callHostPlugin (conn , "vmops" , "setup_iscsi" , "uuid" , _host .uuid );
4750+
4751+ if (cmd .needSetup () ) {
4752+ String result = callHostPlugin (conn , "vmops" , "setup_iscsi" , "uuid" , _host .uuid );
4753+
47424754 if (!result .contains ("> DONE <" )) {
47434755 s_logger .warn ("Unable to setup iscsi: " + result );
47444756 return new SetupAnswer (cmd , result );
0 commit comments