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

ASF GitHub Bot commented on LIBCLOUD-936:
-----------------------------------------

GitHub user lrvan opened a pull request:

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

    [LIBCLOUD-936] fixed AWS ALB/ELB driver init method to instantiate ne…

    …sted connection object properly
    
    ## Fixed AWS ALB/ELB driver init method to instantiate nested connection 
object properly
    
    ### Description
    
    AWS ELB/ALB Driver connection object initialization is broken. 
    
    Code to reproduce:
    `from libcloud.loadbalancer.types import Provider
    from libcloud.loadbalancer.providers import get_driver
    
    key = ''
    secret = ''
    token = ''
    
    cls = get_driver(Provider.ELB)
    #cls = get_driver(Provider.ALB)
    
    driver = cls(key, secret, 'us-east-1', token=token)
    data = driver.list_balancers()`
    
    Error:
    `/Users/irvan/py27venv/bin/python test_token.py
    Traceback (most recent call last):
      File "test_token.py", line 33, in <module>
        data = driver.list_balancers()
      File 
"/Users/irvan/Repos/GIT/github/libcloud/libcloud/loadbalancer/drivers/elb.py", 
line 68, in list_balancers
        data = self.connection.request(ROOT, params=params).object
      File "/Users/irvan/Repos/GIT/github/libcloud/libcloud/common/base.py", 
line 603, in request
        headers=headers, stream=stream)
      File "/Users/irvan/Repos/GIT/github/libcloud/libcloud/http.py", line 215, 
in request
        verify=self.verification
      File 
"/Users/irvan/py27venv/lib/python2.7/site-packages/requests/sessions.py", line 
518, in request
        resp = self.send(prep, **send_kwargs)
      File 
"/Users/irvan/py27venv/lib/python2.7/site-packages/requests/sessions.py", line 
639, in send
        r = adapter.send(request, **kwargs)
      File 
"/Users/irvan/py27venv/lib/python2.7/site-packages/requests/adapters.py", line 
502, in send
        raise ConnectionError(e, request=request)
    requests.exceptions.ConnectionError: 
HTTPSConnectionPool(host='elasticloadbalancing.%s.amazonaws.com', port=443): 
Max retries exceeded with url: 
/2012-06-01/?Action=DescribeLoadBalancers&Version=2012-06-01 (Caused by 
NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection
 object at 0x10760f4d0>: Failed to establish a new connection: [Errno 8] 
nodename nor servname provided, or not known',))`
    
    Issue:
    https://issues.apache.org/jira/browse/LIBCLOUD-936
    
    ### Status
    
    done, ready for review
    
    ### Checklist (tick everything that applies)
    
    - [ ] [Code 
linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide)
 (required, can be done after the PR checks)
    - [ ] Documentation
    - [ ] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
    - [ ] 
[ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes)
 (required for bigger changes)


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

    $ git pull https://github.com/lrvan/libcloud LIBCLOUD-936

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

    https://github.com/apache/libcloud/pull/1089.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 #1089
    
----
commit 0a03bede146c1984daa0c5be2431335c5cedc550
Author: Anton Kozyrev <anton.kozy...@gmail.com>
Date:   2017-08-08T10:08:02Z

    [LIBCLOUD-936] fixed AWS ALB/ELB driver init method to instantiate nested 
connection object properly

----


> AWS ELB/ALB Driver connection object initialization is broken
> -------------------------------------------------------------
>
>                 Key: LIBCLOUD-936
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-936
>             Project: Libcloud
>          Issue Type: Bug
>          Components: LoadBalancer
>            Reporter: Anton Kozyrev
>
> Code to reproduce:
> {code}
> from libcloud.loadbalancer.types import Provider
> from libcloud.loadbalancer.providers import get_driver
> key = ''
> secret = ''
> token = ''
> cls = get_driver(Provider.ELB)
> #cls = get_driver(Provider.ALB)
> driver = cls(key, secret, 'us-east-1', token=token)
> data = driver.list_balancers()
> {code}
> Error:
> {code}
> /Users/irvan/py27venv/bin/python test_token.py
> Traceback (most recent call last):
>   File "test_token.py", line 33, in <module>
>     data = driver.list_balancers()
>   File 
> "/Users/irvan/Repos/GIT/github/libcloud/libcloud/loadbalancer/drivers/elb.py",
>  line 68, in list_balancers
>     data = self.connection.request(ROOT, params=params).object
>   File "/Users/irvan/Repos/GIT/github/libcloud/libcloud/common/base.py", line 
> 603, in request
>     headers=headers, stream=stream)
>   File "/Users/irvan/Repos/GIT/github/libcloud/libcloud/http.py", line 215, 
> in request
>     verify=self.verification
>   File 
> "/Users/irvan/py27venv/lib/python2.7/site-packages/requests/sessions.py", 
> line 518, in request
>     resp = self.send(prep, **send_kwargs)
>   File 
> "/Users/irvan/py27venv/lib/python2.7/site-packages/requests/sessions.py", 
> line 639, in send
>     r = adapter.send(request, **kwargs)
>   File 
> "/Users/irvan/py27venv/lib/python2.7/site-packages/requests/adapters.py", 
> line 502, in send
>     raise ConnectionError(e, request=request)
> requests.exceptions.ConnectionError: 
> HTTPSConnectionPool(host='elasticloadbalancing.%s.amazonaws.com', port=443): 
> Max retries exceeded with url: 
> /2012-06-01/?Action=DescribeLoadBalancers&Version=2012-06-01 (Caused by 
> NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection
>  object at 0x10760f4d0>: Failed to establish a new connection: [Errno 8] 
> nodename nor servname provided, or not known',))
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to