Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 42877DBF3 for ; Thu, 16 May 2013 18:21:44 +0000 (UTC) Received: (qmail 58317 invoked by uid 500); 16 May 2013 18:21:31 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 58261 invoked by uid 500); 16 May 2013 18:21:31 -0000 Mailing-List: contact commits-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 commits@cloudstack.apache.org Received: (qmail 58147 invoked by uid 99); 16 May 2013 18:21:31 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 May 2013 18:21:30 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id D1A2B14F7F; Thu, 16 May 2013 18:21:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: prachidamle@apache.org To: commits@cloudstack.apache.org Date: Thu, 16 May 2013 18:22:13 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [48/68] [abbrv] git commit: updated refs/heads/planner_reserve to ed8ff40 don't let requests logs requests logs to the logger making it hard to distinguish marvin logs from http logs. Signed-off-by: Prasanna Santhanam Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b17be94c Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b17be94c Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b17be94c Branch: refs/heads/planner_reserve Commit: b17be94cf5592e9cfd5d346b3d678f31f0a8e374 Parents: 24cdddb Author: Prasanna Santhanam Authored: Wed May 15 14:51:37 2013 +0530 Committer: Prasanna Santhanam Committed: Wed May 15 14:52:33 2013 +0530 ---------------------------------------------------------------------- tools/marvin/marvin/cloudstackConnection.py | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b17be94c/tools/marvin/marvin/cloudstackConnection.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/cloudstackConnection.py b/tools/marvin/marvin/cloudstackConnection.py index 8039117..b5ff5bf 100644 --- a/tools/marvin/marvin/cloudstackConnection.py +++ b/tools/marvin/marvin/cloudstackConnection.py @@ -20,6 +20,7 @@ import urllib import base64 import hmac import hashlib +import logging import time import cloudstackException from cloudstackAPI import * @@ -37,6 +38,7 @@ class cloudConnection(object): apiKey=None, securityKey=None, asyncTimeout=3600, logging=None, scheme='http', path='client/api'): + self.loglevel() #Turn off requests logs self.apiKey = apiKey self.securityKey = securityKey self.mgtSvr = mgtSvr @@ -65,6 +67,13 @@ class cloudConnection(object): self.asyncTimeout, self.logging, self.protocol, self.path) + def loglevel(self, lvl=logging.WARNING): + """ + Turns off the INFO/DEBUG logs from `requests` + """ + requests_log = logging.getLogger("requests") + requests_log.setLevel(lvl) + def poll(self, jobid, response): """ polls the completion of a given jobid