weizhouapache commented on PR #14741:
URL: https://github.com/apache/cloudstack/pull/14741#issuecomment-7157215775

   > doing smoke tests makes little sense except for the setup so I will just 
install an env without tests and that would prove the backwards compatibility 
of the change instead of a full @blueorangutan test. Agree @weizhouapache ? 
(should we leverage this in regression testing?) Care to do more testing 
@bhouse-nexthop ?
   
   @DaanHoogland 
   I checked the source code, and `sudo` is already used in some cases when the 
username is not `root`.
   
   this change looks reasonable, as it is consistent with the existing 
implementation.
   
   ```
   # egrep -r "sudo|cloudstack-agent" server/src/main/
   server/src/main/java/org/apache/cloudstack/ca/CAManagerImpl.java:            
    String.format("sudo /usr/share/cloudstack-common/scripts/util/%s " +
   server/src/main/java/org/apache/cloudstack/ca/CAManagerImpl.java:            
    String.format("sudo /usr/share/cloudstack-common/scripts/util/%s " +
   server/src/main/java/org/apache/cloudstack/ca/CAManagerImpl.java:            
String sudoPrefix = "root".equals(username) ? "" : "sudo ";
   server/src/main/java/org/apache/cloudstack/ca/CAManagerImpl.java:            
SSHCmdHelper.sshExecuteCmd(sshConnection, sudoPrefix + "systemctl restart 
libvirtd");
   server/src/main/java/org/apache/cloudstack/ca/CAManagerImpl.java:            
SSHCmdHelper.sshExecuteCmd(sshConnection, sudoPrefix + "systemctl restart 
cloudstack-agent");
   
server/src/main/java/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java:
                setupAgentCommand = "sudo cloudstack-setup-agent ";
   server/src/main/java/com/cloud/resource/ResourceManagerImpl.java:            
        connection, "service cloudstack-agent restart");
   server/src/main/java/com/cloud/resource/ResourceManagerImpl.java:            
logger.debug("cloudstack-agent restart result: {}", result);
   ```


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