Pearl1594 commented on a change in pull request #5831:
URL: https://github.com/apache/cloudstack/pull/5831#discussion_r811585656



##########
File path: 
core/src/main/java/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
##########
@@ -173,12 +174,33 @@ private Answer execute(final SetupKeyStoreCommand cmd) {
         return new SetupKeystoreAnswer(result.getDetails());
     }
 
+    private void scpFileToIdentifyPatching(String routerIp, String path, 
String filename, String content) throws InterruptedException {
+        String errMsg = "Failed to scp file: %s to system VM";
+        for (int retries = 15; retries > 0; retries--) {
+            try {
+                _vrDeployer.createFileInVR(routerIp, path, filename, content);
+            } catch (Exception e) {
+                errMsg += ", retrying";
+                s_logger.error(String.format(errMsg, filename), e);
+                Thread.sleep(2000);
+            }
+        }
+    }
     private Answer execute(final SetupCertificateCommand cmd) {
-        final String args = 
String.format("/usr/local/cloud/systemvm/conf/agent.properties " +
+        String routerName = 
cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
+        if (!org.apache.commons.lang3.StringUtils.isEmpty(routerName) && 
(routerName.startsWith("s-") || routerName.startsWith("v-"))) {
+            try {
+                scpFileToIdentifyPatching(cmd.getRouterAccessIp(), 
"/usr/local/cloud/systemvm/conf/", KeyStoreUtils.CERT_FILENAME, 
cmd.getCertificate());

Review comment:
       Sorry @rohityadavcloud I didn't quite understand this. Do you mean pass 
it to the systemvm via the cmdline args?




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