You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/09/02 02:32:20 UTC

[jira] [Commented] (CLOUDSTACK-9470) [BLOCKER] Bug in SshHelper affecting interaction with vRouter in VmwareResource and HypervDirectConnectResource

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-9470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15457288#comment-15457288 ] 

ASF GitHub Bot commented on CLOUDSTACK-9470:
--------------------------------------------

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

    https://github.com/apache/cloudstack/pull/1660#discussion_r77285299
  
    --- Diff: utils/src/main/java/com/cloud/utils/ssh/SshHelper.java ---
    @@ -196,6 +201,16 @@ public static void scpTo(String host, int port, String user, File pemKeyFile, St
     
                 String result = sbResult.toString();
     
    +            if (StringUtils.isBlank(result)) {
    +                try {
    +                    result = IOUtils.toString(stdout, UTF8);
    --- End diff --
    
    Rather than use a homegrown string constant, pass ``StandardCharsets.UTF_8`` instead.  An additional benefit is that it is a ``Charset`` instance which provides greater type safety.


> [BLOCKER] Bug in SshHelper affecting interaction with vRouter in VmwareResource and HypervDirectConnectResource
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-9470
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9470
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: VMware
>    Affects Versions: 4.7.0, 4.8.0, 4.9.0
>            Reporter: Nicolas Vazquez
>            Assignee: Nicolas Vazquez
>             Fix For: 4.10.0.0, 4.9.1.0
>
>
> h2. Problem
> In a Vmware environment, running {{test_network_acl}} we examined why it was failing, it was discovered an issue on {{VmwareResource}}:
> {code:title=VmwareResource.java|borderStyle=solid}
> private int findRouterEthDeviceIndex(String domrName, String routerIp, String mac) throws Exception {
>         VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
>         s_logger.info("findRouterEthDeviceIndex. mac: " + mac);
>         // TODO : this is a temporary very inefficient solution, will refactor it later
>         Pair<Boolean, String> result = SshHelper.sshExecute(routerIp, DefaultDomRSshPort, "root", mgr.getSystemVMKeyFile(), null, "ls /proc/sys/net/ipv4/conf");
> {code}
> Command sent to router returned a pair which its first parameter was always true but second parameter sometimes it was null and sometimes the correct output for given command.
> h2. Solution
> Examining {{SshHelper}} we discovered that cases in which second parameter in result was null, didn't consume stdout properly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)