rhtyd commented on a change in pull request #5684:
URL: https://github.com/apache/cloudstack/pull/5684#discussion_r748155446



##########
File path: utils/src/main/java/com/cloud/utils/ssh/SSHCmdHelper.java
##########
@@ -77,8 +80,47 @@ public String getStdErr() {
     }
 
     public static com.trilead.ssh2.Connection 
acquireAuthorizedConnection(String ip, int port, String username, String 
password) {
+        return acquireAuthorizedConnection(ip, 22, username, password, null);
+    }
+
+    public static boolean acquireAuthorizedConnectionWithPublicKey(final 
com.trilead.ssh2.Connection sshConnection, final String username, final String 
privateKey) {
+        if (StringUtils.isNotBlank(privateKey)) {
+            File privateKeyFile = null;
+            try {
+                privateKeyFile = File.createTempFile("cloudstack-host-", null);

Review comment:
       @weizhouapache 
   This temp. hack may not be required as mgmt server saves the ssh private/pub 
keys at: `/var/lib/cloudstack/management/.ssh/id_rsa` on the mgmt server, why 
not just read/use that?
   
   In fact if this is saved/assumed, then we don't even need to read the 
private key from db and pass it here. Thoughts?

##########
File path: ui/src/views/infra/HostAdd.vue
##########
@@ -94,9 +94,8 @@
         <a-input :placeholder="placeholder.username" 
v-model="username"></a-input>
       </div>
 
-      <div class="form__item required-field" 
v-if="selectedClusterHyperVisorType !== 'VMware'">
-        <div class="form__label"><span class="required">* </span>{{ 
$t('label.password') }}</div>
-        <span class="required required-label">{{ $t('label.required') }}</span>
+      <div class="form__item" v-if="selectedClusterHyperVisorType !== 
'VMware'">
+        <div class="form__label">{{ $t('label.password') }}</div>

Review comment:
       Maybe be have it not required just for kvm? (for ex. required for 
xenserver?)




-- 
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