You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by pq...@apache.org on 2010/01/05 03:58:32 UTC
svn commit: r895868 - /incubator/libcloud/trunk/libcloud/base.py
Author: pquerna
Date: Tue Jan 5 02:58:25 2010
New Revision: 895868
URL: http://svn.apache.org/viewvc?rev=895868&view=rev
Log:
Include libcloud version number in the user agent
Modified:
incubator/libcloud/trunk/libcloud/base.py
Modified: incubator/libcloud/trunk/libcloud/base.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/base.py?rev=895868&r1=895867&r2=895868&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/base.py (original)
+++ incubator/libcloud/trunk/libcloud/base.py Tue Jan 5 02:58:25 2010
@@ -17,6 +17,7 @@
Provides base classes for working with drivers
"""
import httplib, urllib
+import libcloud
from zope import interface
from libcloud.interface import IConnectionUserAndKey, IResponse
from libcloud.interface import IConnectionKey, IConnectionKeyFactory
@@ -289,7 +290,7 @@
headers = self.add_default_headers(headers)
# We always send a content length and user-agent header
headers.update({'Content-Length': len(data)})
- headers.update({'User-Agent': 'libcloud/%s' % (self.driver.name)})
+ headers.update({'User-Agent': 'libcloud/%s (%s)' % (libcloud.__version__, self.driver.name)})
headers.update({'Host': self.host})
# Encode data if necessary
if data != '':