weizhouapache commented on code in PR #12059:
URL: https://github.com/apache/cloudstack/pull/12059#discussion_r2556442089


##########
server/src/main/java/com/cloud/server/ConfigurationServerImpl.java:
##########
@@ -617,7 +617,9 @@ public void updateKeyPairs() {
             // FIXME: take a global database lock here for safety.
             boolean onWindows = isOnWindows();
             if(!onWindows) {
-                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");
+                if (!privkeyfile.exists() && !pubkeyfile.exists()) {

Review Comment:
   you are right @pavanaravapalli 
   
   however, the Copilot's suggestion makes sense then. to be clear
   ```
                   if (!(privkeyfile.exists() && pubkeyfile.exists())) {
   ```
   or 
   ```
                   if (!privkeyfile.exists() || !pubkeyfile.exists()) {
   ```
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to