mirror of https://github.com/apache/cloudstack.git
parent
410092bbe1
commit
44a4158c48
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue