Skip to content

Commit bac3421

Browse files
Fixed: unnecessary regeneration of SSH keys in developer mode when they already existed. (#12059)
1 parent bb8e7d3 commit bac3421

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
@@ -614,7 +614,7 @@ public void updateKeyPairs() {
614614
}
615615
// FIXME: take a global database lock here for safety.
616616
boolean onWindows = isOnWindows();
617-
if(!onWindows) {
617+
if (!onWindows && !(privkeyfile.exists() && pubkeyfile.exists())) {
618618
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");
619619
}
620620

0 commit comments

Comments
 (0)