CLOUDSTACK-6112. Adding VPC router to a guest network fails with StringIndexOutOfBoundsException.

This commit is contained in:
Likitha Shetty 2014-02-14 17:00:03 +05:30
parent ce6539bd43
commit db91e54bf3
1 changed files with 5 additions and 3 deletions

View File

@ -270,9 +270,11 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru, Co
for (NicTO nicTo : sortNicsByDeviceId(to.getNics())) {
sbMacSequence.append(nicTo.getMac()).append("|");
}
sbMacSequence.deleteCharAt(sbMacSequence.length() - 1);
String bootArgs = to.getBootArgs();
to.setBootArgs(bootArgs + " nic_macs=" + sbMacSequence.toString());
if (!sbMacSequence.toString().isEmpty()) {
sbMacSequence.deleteCharAt(sbMacSequence.length() - 1);
String bootArgs = to.getBootArgs();
to.setBootArgs(bootArgs + " nic_macs=" + sbMacSequence.toString());
}
}