File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -327,10 +327,18 @@ public boolean isPoolSupportHA() {
327327 public String getHearthBeatPath () {
328328 if (StoragePoolType .NetworkFilesystem .equals (type )) {
329329 String kvmScriptsDir = AgentPropertiesFileHandler .getPropertyValue (AgentProperties .KVM_SCRIPTS_DIR );
330- return Script .findScript (kvmScriptsDir , "kvmheartbeat.sh" );
330+ String scriptPath = Script .findScript (kvmScriptsDir , "kvmheartbeat.sh" );
331+ if (scriptPath == null ) {
332+ throw new CloudRuntimeException ("Unable to find heartbeat script 'kvmheartbeat.sh' in directory: " + kvmScriptsDir );
333+ }
334+ return scriptPath ;
331335 } else if (StoragePoolType .SharedMountPoint .equals (type )) {
332336 String kvmScriptsDir = AgentPropertiesFileHandler .getPropertyValue (AgentProperties .KVM_SCRIPTS_DIR );
333- return Script .findScript (kvmScriptsDir , "kvmsmpheartbeat.sh" );
337+ String scriptPath = Script .findScript (kvmScriptsDir , "kvmsmpheartbeat.sh" );
338+ if (scriptPath == null ) {
339+ throw new CloudRuntimeException ("Unable to find heartbeat script 'kvmsmpheartbeat.sh' in directory: " + kvmScriptsDir );
340+ }
341+ return scriptPath ;
334342 }
335343 return null ;
336344 }
You can’t perform that action at this time.
0 commit comments