Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 547042009FB for ; Fri, 6 May 2016 14:58:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 53391160A0D; Fri, 6 May 2016 12:58:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A6BB81609F6 for ; Fri, 6 May 2016 14:58:15 +0200 (CEST) Received: (qmail 55088 invoked by uid 500); 6 May 2016 12:58:13 -0000 Mailing-List: contact issues-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list issues@cloudstack.apache.org Received: (qmail 54869 invoked by uid 500); 6 May 2016 12:58:13 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 54810 invoked by uid 99); 6 May 2016 12:58:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 May 2016 12:58:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 0EB802C1F68 for ; Fri, 6 May 2016 12:58:13 +0000 (UTC) Date: Fri, 6 May 2016 12:58:13 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CLOUDSTACK-9299) Out-of-band Management for CloudStack MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 06 May 2016 12:58:16 -0000 [ https://issues.apache.org/jira/browse/CLOUDSTACK-9299?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D15273997#comment-15273997 ]=20 ASF GitHub Bot commented on CLOUDSTACK-9299: -------------------------------------------- Github user jburwell commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1502#discussion_r62325927 =20 --- Diff: utils/src/main/java/org/apache/cloudstack/utils/process/Proce= ssRunner.java --- @@ -0,0 +1,111 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// + +package org.apache.cloudstack.utils.process; + +import org.apache.log4j.Logger; + +import java.io.IOException; +import java.util.List; + +public class ProcessRunner { + public static final Logger LOG =3D Logger.getLogger(ProcessRunner.= class); + + private String stdOutput; + private String stdError; + private int returnCode =3D -1; + + public String getStdOutput() { + return stdOutput; + } + + public void setStdOutput(String stdOutput) { + this.stdOutput =3D stdOutput; + } + + public String getStdError() { + return stdError; + } + + public void setStdError(String stdError) { + this.stdError =3D stdError; + } + + public int getReturnCode() { + return returnCode; + } + + public void setReturnCode(int returnCode) { + this.returnCode =3D returnCode; + } + + public static ProcessRunner executeCommands(List commands,= long timeOutSeconds) { + ProcessRunner result =3D new ProcessRunner(); + try { + Process process =3D new ProcessBuilder().command(commands)= .start(); + StreamGobbler stdInputGobbler =3D new StreamGobbler(proces= s.getInputStream()); + StreamGobbler stdErrorGobbler =3D new StreamGobbler(proces= s.getErrorStream()); --- End diff -- =20 The ``StreamGobbler`` idiom was replaced with ``ProcessBuilder.inheritI= O`` in Java 1.7+. Using it would simplify this code and allow the removal = of the ``StreamGobbler`` class. > Out-of-band Management for CloudStack > ------------------------------------- > > Key: CLOUDSTACK-9299 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-929= 9 > Project: CloudStack > Issue Type: New Feature > Security Level: Public(Anyone can view this level - this is the defa= ult.)=20 > Reporter: Rohit Yadav > Assignee: Rohit Yadav > Fix For: 4.9.0, Future > > > Support access to a host=E2=80=99s out-of-band management interface (e.g.= IPMI, iLO, DRAC, etc.) to manage host power operations (on/off etc.) and q= uerying current power state. > FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Out-of-band+Ma= nagement+for+CloudStack -- This message was sent by Atlassian JIRA (v6.3.4#6332)