Return-Path: X-Original-To: apmail-cloudstack-issues-archive@www.apache.org Delivered-To: apmail-cloudstack-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4146A1799F for ; Fri, 3 Oct 2014 11:12:35 +0000 (UTC) Received: (qmail 37342 invoked by uid 500); 3 Oct 2014 11:12:35 -0000 Delivered-To: apmail-cloudstack-issues-archive@cloudstack.apache.org Received: (qmail 37318 invoked by uid 500); 3 Oct 2014 11:12:35 -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 37309 invoked by uid 500); 3 Oct 2014 11:12:35 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 37306 invoked by uid 99); 3 Oct 2014 11:12:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Oct 2014 11:12:35 +0000 Date: Fri, 3 Oct 2014 11:12:34 +0000 (UTC) From: "Rohit Yadav (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (CLOUDSTACK-7670) Cloudmonkey should not force coloured output when not interactive MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CLOUDSTACK-7670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rohit Yadav closed CLOUDSTACK-7670. ----------------------------------- Resolution: Fixed Fixed on master > Cloudmonkey should not force coloured output when not interactive > ----------------------------------------------------------------- > > Key: CLOUDSTACK-7670 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7670 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the default.) > Components: Cloudmonkey > Environment: # cloudmonkey --version > cloudmonkey 5.2.0 > Reporter: Shalom Bhooshi > Assignee: Rohit Yadav > > {code}# grep -B 1 -i color ~/.cloudmonkey/config > [ui] > color = true > {code} > When the output from cloudmonkey is coloured (the words ''404'' and ''Error'' in the output below). > {code} > cloudmonkey list zones > 404 Client Error: Not Found > {code} > One would expect to be able to pipe this output to another util to parse it > {code} > # cloudmonkey list zones | grep 'Client Error'; echo $? > 1 > {code} > However, that does not match due to there being the non-printable ANSI codes to colour the output around the word ''Error''. This is not expected. > {code} > # cloudmonkey list zones | cat -et > ^[[34;01m404^[[39;49;00m^[[39;49;00m ^[[39;49;00m^[[39;49;00mClient^[[39;49;00m^[[39;49;00m ^[[39;49;00m^[[31;01mError^[[39;49;00m^[[39;49;00m:^[[39;49;00m^[[39;49;00m ^[[39;49;00m^[[39;49;00mNot^[[39;49;00m^[[39;49;00m ^[[39;49;00m^[[39;49;00mFound^[[39;49;00m$ > # cloudmonkey list zones | grep 'Client.*Error'; echo $? > 404 Client Error: Not Found > 0 > {code} > Cloudmonkey ought to test if the output is interactive and only display in colour if it is through something like so > {code} > if sys.flags.interactive: > #interactive, colours are ok > else: > #not interactive, colours are not ok. > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)