Return-Path: X-Original-To: apmail-libcloud-commits-archive@www.apache.org Delivered-To: apmail-libcloud-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 12CFEDCDD for ; Fri, 24 May 2013 19:00:55 +0000 (UTC) Received: (qmail 26027 invoked by uid 500); 24 May 2013 19:00:55 -0000 Delivered-To: apmail-libcloud-commits-archive@libcloud.apache.org Received: (qmail 26003 invoked by uid 500); 24 May 2013 19:00:54 -0000 Mailing-List: contact commits-help@libcloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@libcloud.apache.org Delivered-To: mailing list commits@libcloud.apache.org Received: (qmail 25984 invoked by uid 99); 24 May 2013 19:00:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 May 2013 19:00:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 May 2013 19:00:52 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DFCAC2388AB8; Fri, 24 May 2013 19:00:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1486170 - /libcloud/branches/0.12.x/libcloud/__init__.py Date: Fri, 24 May 2013 19:00:31 -0000 To: commits@libcloud.apache.org From: tomaz@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130524190031.DFCAC2388AB8@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tomaz Date: Fri May 24 19:00:31 2013 New Revision: 1486170 URL: http://svn.apache.org/r1486170 Log: Only import libcloud.utils.debug module if enable_requests_stats environment variable is set. Modified: libcloud/branches/0.12.x/libcloud/__init__.py Modified: libcloud/branches/0.12.x/libcloud/__init__.py URL: http://svn.apache.org/viewvc/libcloud/branches/0.12.x/libcloud/__init__.py?rev=1486170&r1=1486169&r2=1486170&view=diff ============================================================================== --- libcloud/branches/0.12.x/libcloud/__init__.py (original) +++ libcloud/branches/0.12.x/libcloud/__init__.py Fri May 24 19:00:31 2013 @@ -32,9 +32,6 @@ except ImportError: have_paramiko = False -from libcloud.utils.debug import print_request_statistics - - def enable_debug(fo): """ Enable library wide debugging to a file-like object. @@ -55,6 +52,8 @@ def enable_debug(fo): enable_requests_stats = os.getenv('LIBCLOUD_REQUESTS_STATS') if enable_requests_stats: + from libcloud.utils.debug import print_request_statistics + LoggingHTTPSConnection.enable_requests_stats = True LoggingHTTPConnection.enable_requests_stats = True atexit.register(print_request_statistics, fo=fo,