@@ -5019,6 +5019,16 @@ private void cleanupTemplateSR(Connection conn) {
50195019 }
50205020 }
50215021
5022+ protected boolean launchHeartBeat (Connection conn ) {
5023+ String result = callHostPluginPremium (conn , "heartbeat" , "host" , _host .uuid , "interval" , Integer
5024+ .toString (_heartbeatInterval ));
5025+ if (result == null || !result .contains ("> DONE <" )) {
5026+ s_logger .warn ("Unable to launch the heartbeat process on " + _host .ip );
5027+ return false ;
5028+ }
5029+ return true ;
5030+ }
5031+
50225032 protected SetupAnswer execute (SetupCommand cmd ) {
50235033 Connection conn = getConnection ();
50245034 setupServer (conn );
@@ -5032,12 +5042,11 @@ protected SetupAnswer execute(SetupCommand cmd) {
50325042 _canBridgeFirewall = can_bridge_firewall (conn );
50335043 }
50345044
5035- String result = callHostPluginPremium (conn , "heartbeat" , "host" , _host .uuid , "interval" , Integer
5036- .toString (_heartbeatInterval ));
5037- if (result == null || !result .contains ("> DONE <" )) {
5038- s_logger .warn ("Unable to launch the heartbeat process on " + _host .ip );
5045+ boolean r = launchHeartBeat (conn );
5046+ if (!r ) {
50395047 return null ;
50405048 }
5049+
50415050 cleanupTemplateSR (conn );
50425051 Host host = Host .getByUuid (conn , _host .uuid );
50435052 try {
@@ -5051,7 +5060,7 @@ protected SetupAnswer execute(SetupCommand cmd) {
50515060 s_logger .debug ("multipath is already set" );
50525061 }
50535062 if (cmd .needSetup () ) {
5054- result = callHostPlugin (conn , "vmops" , "setup_iscsi" , "uuid" , _host .uuid );
5063+ String result = callHostPlugin (conn , "vmops" , "setup_iscsi" , "uuid" , _host .uuid );
50555064 if (!result .contains ("> DONE <" )) {
50565065 s_logger .warn ("Unable to setup iscsi: " + result );
50575066 return new SetupAnswer (cmd , result );
0 commit comments