mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	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 <tsp@apache.org>
This commit is contained in:
		
							parent
							
								
									24cdddbf5e
								
							
						
					
					
						commit
						b17be94cf5
					
				@ -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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user