Skip to content

Commit db91e54

Browse files
author
Likitha Shetty
committed
CLOUDSTACK-6112. Adding VPC router to a guest network fails with StringIndexOutOfBoundsException.
1 parent ce6539b commit db91e54

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,11 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) {
270270
for (NicTO nicTo : sortNicsByDeviceId(to.getNics())) {
271271
sbMacSequence.append(nicTo.getMac()).append("|");
272272
}
273-
sbMacSequence.deleteCharAt(sbMacSequence.length() - 1);
274-
String bootArgs = to.getBootArgs();
275-
to.setBootArgs(bootArgs + " nic_macs=" + sbMacSequence.toString());
273+
if (!sbMacSequence.toString().isEmpty()) {
274+
sbMacSequence.deleteCharAt(sbMacSequence.length() - 1);
275+
String bootArgs = to.getBootArgs();
276+
to.setBootArgs(bootArgs + " nic_macs=" + sbMacSequence.toString());
277+
}
276278

277279
}
278280

0 commit comments

Comments
 (0)