Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1678#discussion_r80065874
  
    --- Diff: 
plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
 ---
    @@ -1660,18 +1661,18 @@ public StopAnswer execute(final StopCommand cmd) {
         @Override
         public ExecutionResult executeInVR(final String routerIP, final String 
script, final String args) {
             // Timeout is 120 seconds by default
    -        return executeInVR(routerIP, script, args, 120);
    +        return executeInVR(routerIP, script, args, 
Duration.standardSeconds(120L));
         }
     
         @Override
    -    public ExecutionResult executeInVR(final String routerIP, final String 
script, final String args, final int timeout) {
    +    public ExecutionResult executeInVR(final String routerIP, final String 
script, final String args, final Duration timeout) {
             Pair<Boolean, String> result;
             String cmdline = "/opt/cloud/bin/router_proxy.sh " + script + " " 
+ routerIP + " " + args;
             // semicolon need to be escape for bash
             cmdline = cmdline.replaceAll(";", "\\\\;");
             try {
                 s_logger.debug("Executing command in VR: " + cmdline);
    -            result = SshHelper.sshExecute(_host.getIp(), 22, _username, 
null, _password.peek(), cmdline, 60000, 60000, timeout * 1000);
    +            result = SshHelper.sshExecute(_host.getIp(), 22, _username, 
null, _password.peek(), cmdline, 60000, 60000, (int)timeout.getMillis());
    --- End diff --
    
    Please consider adding an overridden version of the 
`SshHelper.sshExecute(String, int, String, String, ??, String, int, int, int)` 
method that accepts `Duration` to encapsulate this type conversion.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to