[jira] [Commented] (LIBCLOUD-910) Not a Gzipped file when using LIBCLOUD_DEBUG

2017-04-05 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/LIBCLOUD-910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15958197#comment-15958197
 ] 

ASF subversion and git services commented on LIBCLOUD-910:
--

Commit 4e5ddfbf2ab6c3bbaf7b2092ce3094dff54d5b59 in libcloud's branch 
refs/heads/trunk from [~anthonypjshaw]
[ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=4e5ddfb ]

add test to show LIBCLOUD-910 failure


> Not a Gzipped file when using LIBCLOUD_DEBUG
> 
>
> Key: LIBCLOUD-910
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-910
> Project: Libcloud
>  Issue Type: Bug
>  Components: Core
> Environment: python 2.6, debian jessie
>Reporter: Tom Melendez
>
> ## Summary
> When LIBCLOUD_DEBUG is set, receive a gzip error.  If the call to 
> decompress_data is commented out, things progress fine. 
> Offending line:
>   File "./libcloud/utils/loggingconnection.py", line 71, in _log_response
> body = decompress_data('gzip', body)
> ## Stacktrace
> (libcloud-testing) 
> supertom@supertom:~/virts/libcloud-testing/code/apache-libcloud-2.0.0rc2$ 
> demos/gce_demo.py --compute
> => Compute demo/test start time: 2017-04-05 16:22:58.309187
> DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTPS connection 
> (1): www.googleapis.com
> DEBUG:requests.packages.urllib3.connectionpool:https://www.googleapis.com:443 
> "GET /compute/v1/projects/supertom-graphite/zones HTTP/1.1" 200 None
> /usr/lib/python2.7/gzip.py:196: UnicodeWarning: Unicode unequal comparison 
> failed to convert both arguments to Unicode - interpreting them as being 
> unequal
>   if magic != '\037\213':
> Traceback (most recent call last):
>   File "demos/gce_demo.py", line 957, in 
> main_compute()
>   File "demos/gce_demo.py", line 342, in main_compute
> gce = get_gce_driver()
>   File "demos/gce_demo.py", line 111, in get_gce_driver
> driver = get_driver(Provider.GCE)(*args, **kwargs)
>   File "./libcloud/compute/drivers/gce.py", line 1803, in __init__
> self.zone_list = self.ex_list_zones()
>   File "./libcloud/compute/drivers/gce.py", line 2757, in ex_list_zones
> response = self.connection.request(request, method='GET').object
>   File "./libcloud/compute/drivers/gce.py", line 121, in request
> response = super(GCEConnection, self).request(*args, **kwargs)
>   File "./libcloud/common/google.py", line 806, in request
> *args, **kwargs)
>   File "./libcloud/common/base.py", line 664, in request
> 'response': self.connection.getresponse()}
>   File "./libcloud/utils/loggingconnection.py", line 141, in getresponse
> rv = self._log_response(HttpLibResponseProxy(original_response))
>   File "./libcloud/utils/loggingconnection.py", line 71, in _log_response
> body = decompress_data('gzip', body)
>   File "./libcloud/utils/compression.py", line 39, in decompress_data
> return gzip.GzipFile(fileobj=cls(data)).read()
>   File "/usr/lib/python2.7/gzip.py", line 261, in read
> self._read(readsize)
>   File "/usr/lib/python2.7/gzip.py", line 303, in _read
> self._read_gzip_header()
>   File "/usr/lib/python2.7/gzip.py", line 197, in _read_gzip_header
> raise IOError, 'Not a gzipped file'
> IOError: Not a gzipped file
> ## Steps to reproduce
> export LIBCLOUD_DEBUG=/tmp/gce-libcloud.log
> (set values in demos/secrets.py)
> demos/gce_demo.py --compute



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (LIBCLOUD-910) Not a Gzipped file when using LIBCLOUD_DEBUG

2017-04-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LIBCLOUD-910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15958195#comment-15958195
 ] 

ASF GitHub Bot commented on LIBCLOUD-910:
-

Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/1025


> Not a Gzipped file when using LIBCLOUD_DEBUG
> 
>
> Key: LIBCLOUD-910
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-910
> Project: Libcloud
>  Issue Type: Bug
>  Components: Core
> Environment: python 2.6, debian jessie
>Reporter: Tom Melendez
>
> ## Summary
> When LIBCLOUD_DEBUG is set, receive a gzip error.  If the call to 
> decompress_data is commented out, things progress fine. 
> Offending line:
>   File "./libcloud/utils/loggingconnection.py", line 71, in _log_response
> body = decompress_data('gzip', body)
> ## Stacktrace
> (libcloud-testing) 
> supertom@supertom:~/virts/libcloud-testing/code/apache-libcloud-2.0.0rc2$ 
> demos/gce_demo.py --compute
> => Compute demo/test start time: 2017-04-05 16:22:58.309187
> DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTPS connection 
> (1): www.googleapis.com
> DEBUG:requests.packages.urllib3.connectionpool:https://www.googleapis.com:443 
> "GET /compute/v1/projects/supertom-graphite/zones HTTP/1.1" 200 None
> /usr/lib/python2.7/gzip.py:196: UnicodeWarning: Unicode unequal comparison 
> failed to convert both arguments to Unicode - interpreting them as being 
> unequal
>   if magic != '\037\213':
> Traceback (most recent call last):
>   File "demos/gce_demo.py", line 957, in 
> main_compute()
>   File "demos/gce_demo.py", line 342, in main_compute
> gce = get_gce_driver()
>   File "demos/gce_demo.py", line 111, in get_gce_driver
> driver = get_driver(Provider.GCE)(*args, **kwargs)
>   File "./libcloud/compute/drivers/gce.py", line 1803, in __init__
> self.zone_list = self.ex_list_zones()
>   File "./libcloud/compute/drivers/gce.py", line 2757, in ex_list_zones
> response = self.connection.request(request, method='GET').object
>   File "./libcloud/compute/drivers/gce.py", line 121, in request
> response = super(GCEConnection, self).request(*args, **kwargs)
>   File "./libcloud/common/google.py", line 806, in request
> *args, **kwargs)
>   File "./libcloud/common/base.py", line 664, in request
> 'response': self.connection.getresponse()}
>   File "./libcloud/utils/loggingconnection.py", line 141, in getresponse
> rv = self._log_response(HttpLibResponseProxy(original_response))
>   File "./libcloud/utils/loggingconnection.py", line 71, in _log_response
> body = decompress_data('gzip', body)
>   File "./libcloud/utils/compression.py", line 39, in decompress_data
> return gzip.GzipFile(fileobj=cls(data)).read()
>   File "/usr/lib/python2.7/gzip.py", line 261, in read
> self._read(readsize)
>   File "/usr/lib/python2.7/gzip.py", line 303, in _read
> self._read_gzip_header()
>   File "/usr/lib/python2.7/gzip.py", line 197, in _read_gzip_header
> raise IOError, 'Not a gzipped file'
> IOError: Not a gzipped file
> ## Steps to reproduce
> export LIBCLOUD_DEBUG=/tmp/gce-libcloud.log
> (set values in demos/secrets.py)
> demos/gce_demo.py --compute



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (LIBCLOUD-910) Not a Gzipped file when using LIBCLOUD_DEBUG

2017-04-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LIBCLOUD-910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15958139#comment-15958139
 ] 

ASF GitHub Bot commented on LIBCLOUD-910:
-

GitHub user tonybaloney opened a pull request:

https://github.com/apache/libcloud/pull/1025

LIBCLOUD-910 error with LIBCLOUD_DEBUG and compressed responses

As reported in LIBCLOUD-910, the loggingconnection, used with 
`LIBCLOUD_DEBUG` is enabled still inspects the `content-encoding` header and 
tries to decode the responses.

`requests` handles this via `urllib3` which has inbuilt decompression so 
this entire code block and module is not needed.

- [ ] provide test
- [ ] Fix issue
- [ ] check test


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/tonybaloney/libcloud libcloud_910

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/libcloud/pull/1025.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1025


commit 4e5ddfbf2ab6c3bbaf7b2092ce3094dff54d5b59
Author: Anthony Shaw 
Date:   2017-04-06T01:16:32Z

add test to show LIBCLOUD-910 failure




> Not a Gzipped file when using LIBCLOUD_DEBUG
> 
>
> Key: LIBCLOUD-910
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-910
> Project: Libcloud
>  Issue Type: Bug
>  Components: Core
> Environment: python 2.6, debian jessie
>Reporter: Tom Melendez
>
> ## Summary
> When LIBCLOUD_DEBUG is set, receive a gzip error.  If the call to 
> decompress_data is commented out, things progress fine. 
> Offending line:
>   File "./libcloud/utils/loggingconnection.py", line 71, in _log_response
> body = decompress_data('gzip', body)
> ## Stacktrace
> (libcloud-testing) 
> supertom@supertom:~/virts/libcloud-testing/code/apache-libcloud-2.0.0rc2$ 
> demos/gce_demo.py --compute
> => Compute demo/test start time: 2017-04-05 16:22:58.309187
> DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTPS connection 
> (1): www.googleapis.com
> DEBUG:requests.packages.urllib3.connectionpool:https://www.googleapis.com:443 
> "GET /compute/v1/projects/supertom-graphite/zones HTTP/1.1" 200 None
> /usr/lib/python2.7/gzip.py:196: UnicodeWarning: Unicode unequal comparison 
> failed to convert both arguments to Unicode - interpreting them as being 
> unequal
>   if magic != '\037\213':
> Traceback (most recent call last):
>   File "demos/gce_demo.py", line 957, in 
> main_compute()
>   File "demos/gce_demo.py", line 342, in main_compute
> gce = get_gce_driver()
>   File "demos/gce_demo.py", line 111, in get_gce_driver
> driver = get_driver(Provider.GCE)(*args, **kwargs)
>   File "./libcloud/compute/drivers/gce.py", line 1803, in __init__
> self.zone_list = self.ex_list_zones()
>   File "./libcloud/compute/drivers/gce.py", line 2757, in ex_list_zones
> response = self.connection.request(request, method='GET').object
>   File "./libcloud/compute/drivers/gce.py", line 121, in request
> response = super(GCEConnection, self).request(*args, **kwargs)
>   File "./libcloud/common/google.py", line 806, in request
> *args, **kwargs)
>   File "./libcloud/common/base.py", line 664, in request
> 'response': self.connection.getresponse()}
>   File "./libcloud/utils/loggingconnection.py", line 141, in getresponse
> rv = self._log_response(HttpLibResponseProxy(original_response))
>   File "./libcloud/utils/loggingconnection.py", line 71, in _log_response
> body = decompress_data('gzip', body)
>   File "./libcloud/utils/compression.py", line 39, in decompress_data
> return gzip.GzipFile(fileobj=cls(data)).read()
>   File "/usr/lib/python2.7/gzip.py", line 261, in read
> self._read(readsize)
>   File "/usr/lib/python2.7/gzip.py", line 303, in _read
> self._read_gzip_header()
>   File "/usr/lib/python2.7/gzip.py", line 197, in _read_gzip_header
> raise IOError, 'Not a gzipped file'
> IOError: Not a gzipped file
> ## Steps to reproduce
> export LIBCLOUD_DEBUG=/tmp/gce-libcloud.log
> (set values in demos/secrets.py)
> demos/gce_demo.py --compute



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)