Skip to content

Commit 60b23c1

Browse files
Fixed: unnecessary regeneration of SSH keys in developer mode when they already existed.
1 parent 5f9e131 commit 60b23c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/java/com/cloud/server/ConfigurationServerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ public void updateKeyPairs() {
616616
}
617617
// FIXME: take a global database lock here for safety.
618618
boolean onWindows = isOnWindows();
619-
if(!onWindows) {
619+
if (!onWindows && !(privkeyfile.exists() && pubkeyfile.exists())) {
620620
Script.runSimpleBashScript("if [ -f " + privkeyfile + " ]; then rm -f " + privkeyfile + "; fi; ssh-keygen -t ecdsa -m PEM -N '' -f " + privkeyfile + " -q 2>/dev/null || ssh-keygen -t ecdsa -N '' -f " + privkeyfile + " -q");
621621
}
622622

0 commit comments

Comments
 (0)