Skip to content
This repository was archived by the owner on Sep 25, 2019. It is now read-only.
This repository was archived by the owner on Sep 25, 2019. It is now read-only.

HTTPRequest conflict #8

@AlanKK

Description

@AlanKK

I am trying to get asyncdynamo working but an having conflict between the boto's HTTPrequest and Tornado's.

> /usr/local/lib/python2.7/dist-packages/boto/auth.py(338)host_header()
-> port = http_request.port
(Pdb) http_request.port
*** AttributeError: 'HTTPRequest' object has no attribute 'port'
(Pdb) http_request
<tornado.httpclient.HTTPRequest object at 0xb6b5584c>
(Pdb) l
333                         value = value.decode('utf-8')
334                     headers_to_sign[name] = value
335             return headers_to_sign
336     
337         def host_header(self, host, http_request):
338  ->         port = http_request.port
339             secure = http_request.protocol == 'https'
340             if ((port == 80 and not secure) or (port == 443 and secure)):
341                 return host
342             return '%s:%s' % (host, port)

How can I get around this? The code above is from boto, auth.py

My code looks like this:

11     db = asyncdynamo.AsyncDynamoDB(
 12                     aws_access_key_id = 'mykey',
 13                     aws_secret_access_key = 'mysecretkey')
 14 
 15     hash = '4b2000150772271378818b51a66f29fc4034fd38599f3d9a5ce1c2836f59b6c7'
 16     response = yield db.get_item(
 17                         'file_record',
 18                         {'shorthash': hash[:3], 'sha256': hash},
 19                         None)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions