CLOUDSTACK-6278

Baremetal Advanced Networking support
This commit is contained in:
Frank Zhang 2014-09-25 10:35:33 -07:00
parent 410092bbe1
commit 44a4158c48
1 changed files with 9 additions and 4 deletions

View File

@ -160,15 +160,20 @@ public class BaremetalKickStartServiceImpl extends BareMetalPxeServiceBase imple
return Arrays.asList(ks, kernel, initrd);
}
private File getSystemVMKeyFile() {
public File getSystemVMKeyFile() {
URL url = this.getClass().getClassLoader().getResource("scripts/vm/systemvm/id_rsa.cloud");
File keyFile = null;
if (url != null) {
keyFile = new File(url.getPath());
}
if (keyFile == null || !keyFile.canRead()) {
s_logger.error("Unable to locate id_rsa.cloud");
return null;
if (keyFile == null || !keyFile.exists()) {
keyFile = new File("/usr/share/cloudstack-common/scripts/vm/systemvm/id_rsa.cloud");
}
if (!keyFile.exists()) {
throw new CloudRuntimeException(String.format("cannot find id_rsa.cloud"));
}
if (!keyFile.exists()) {
s_logger.error("Unable to locate id_rsa.cloud in your setup at " + keyFile.toString());
}
return keyFile;
}