Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CEDA3119D0 for ; Sat, 7 Jun 2014 15:44:05 +0000 (UTC) Received: (qmail 83255 invoked by uid 500); 7 Jun 2014 15:44:05 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 83221 invoked by uid 500); 7 Jun 2014 15:44:05 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 83203 invoked by uid 99); 7 Jun 2014 15:44:05 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jun 2014 15:44:05 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 7442A1D42D2; Sat, 7 Jun 2014 15:43:55 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============4221494983989982990==" MIME-Version: 1.0 Subject: Re: Review Request 22320: Agent Custom Command Output Coerces Integers to Floats From: "Sid Wagle" To: "Sid Wagle" , "Myroslav Papirkovskyy" , "Nate Cole" Cc: "Jonathan Hurley" , "Ambari" Date: Sat, 07 Jun 2014 15:43:55 -0000 Message-ID: <20140607154355.10016.31920@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Sid Wagle" X-ReviewGroup: Ambari X-ReviewRequest-URL: https://reviews.apache.org/r/22320/ X-Sender: "Sid Wagle" References: <20140607040319.10016.38238@reviews.apache.org> In-Reply-To: <20140607040319.10016.38238@reviews.apache.org> Reply-To: "Sid Wagle" X-ReviewRequest-Repository: ambari --===============4221494983989982990== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/22320/#review45017 ----------------------------------------------------------- Ship it! Ship It! - Sid Wagle On June 7, 2014, 4:03 a.m., Jonathan Hurley wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/22320/ > ----------------------------------------------------------- > > (Updated June 7, 2014, 4:03 a.m.) > > > Review request for Ambari, Myroslav Papirkovskyy, Nate Cole, and Sid Wagle. > > > Bugs: AMBARI-6056 > https://issues.apache.org/jira/browse/AMBARI-6056 > > > Repository: ambari > > > Description > ------- > > The JSON in the structured output is returned as a string to the server from the agent. When using gson, integers are converted to doubles when there is no first-class object mapping. The overall problem is that structured_output is very ambiguous and we'd need to provide contracts for each possible returned entity. This is something for another Jira that I will open up. > > In the meantime, using Jackson returns the correctly output JSON structure. > > > Diffs > ----- > > ambari-agent/src/main/python/ambari_agent/ActionQueue.py 749e8c1 > ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 492e025 > ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 00d0c0a > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/TaskResourceProvider.java 87b915f > ambari-server/src/main/resources/custom_actions/check_host.py f98492b > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/TaskResourceProviderTest.java 537d999 > ambari-server/src/test/python/TestCheckHost.py 0ba0386 > ambari-server/src/test/resources/custom_actions/invalid_check.json PRE-CREATION > > Diff: https://reviews.apache.org/r/22320/diff/ > > > Testing > ------- > > Added extra tests around invalid data and fixed up existing tests to validate the integers. > > [INFO] Ambari Main ....................................... SUCCESS [2.044s] > [INFO] Apache Ambari Project POM ......................... SUCCESS [0.243s] > [INFO] Ambari Web ........................................ SUCCESS [9.719s] > [INFO] Ambari Views ...................................... SUCCESS [1.339s] > [INFO] Ambari Server ..................................... SUCCESS [13:27.097s] > [INFO] Ambari Agent ...................................... SUCCESS [6.897s] > [INFO] Ambari Client ..................................... SUCCESS [0.034s] > [INFO] Ambari Python Client .............................. SUCCESS [0.269s] > [INFO] Ambari Groovy Client .............................. SUCCESS [2.735s] > [INFO] Ambari Shell ...................................... SUCCESS [4.303s] > [INFO] ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > > > Thanks, > > Jonathan Hurley > > --===============4221494983989982990==--