Skip to content

Commit cf36fb0

Browse files
authored
Set nfsVersion in ssvm agent.properties only if it is not null (#12445)
1 parent da518e9 commit cf36fb0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,8 +1224,10 @@ public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, Depl
12241224
if (dc.getDns2() != null) {
12251225
buf.append(" dns2=").append(dc.getDns2());
12261226
}
1227-
String nfsVersion = imageStoreDetailsUtil != null ? imageStoreDetailsUtil.getNfsVersion(secStores.get(0).getId()) : null;
1228-
buf.append(" nfsVersion=").append(nfsVersion);
1227+
String nfsVersion = imageStoreDetailsUtil.getNfsVersion(secStores.get(0).getId());
1228+
if (StringUtils.isNotBlank(nfsVersion)) {
1229+
buf.append(" nfsVersion=").append(nfsVersion);
1230+
}
12291231
buf.append(" keystore_password=").append(VirtualMachineGuru.getEncodedString(PasswordGenerator.generateRandomPassword(16)));
12301232
String bootArgs = buf.toString();
12311233
if (logger.isDebugEnabled()) {

0 commit comments

Comments
 (0)