Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

ELB parsing broken when listeners have applied policies #755

Closed
jimbrowne opened this issue May 16, 2012 · 5 comments
Closed

ELB parsing broken when listeners have applied policies #755

jimbrowne opened this issue May 16, 2012 · 5 comments

Comments

@jimbrowne
Copy link
Contributor

Tested against 2.1.1 and 2.4.0. Looks like loadbalancer.py is expecting only Listener stanzas inside of the member list for ListenerDescriptions. When PolicyNames is just a close tag it winds up as a setattr in the Listener object; when PolicyNames is its own list with enclosed member tags the parser is confused.

>>> elbs = elb.get_all_load_balancers('foo-vip')
>>> f = elbs[0]
>>> f.listeners[0].member
u'foo-vip-policy'
>>> f.listeners[0].protocol
''
>>> f.listeners[0].instance_port
0

See the PolicyNames description at http://docs.amazonwebservices.com/ElasticLoadBalancing/latest/APIReference/API_ListenerDescription.html

Anonymized section of XML return from AWS API:

<ListenerDescriptions>
  <member>
    <PolicyNames>
      <member>foo-vip-policy</member>
    </PolicyNames>
    <Listener>
      <Protocol>HTTP</Protocol>
      <LoadBalancerPort>80</LoadBalancerPort>
      <InstanceProtocol>HTTP</InstanceProtocol>
      <InstancePort>80</InstancePort>
    </Listener>
  </member>
  <member>
    <PolicyNames>
      <member>foo-vip-policy</member>
    </PolicyNames>
    <Listener>
      <Protocol>HTTPS</Protocol>
      <LoadBalancerPort>443</LoadBalancerPort>
      <InstanceProtocol>HTTP</InstanceProtocol>
      <SSLCertificateId>arn:aws:iam::12345678:server-certificate/foo.example.com.cert</SSLCertificateId>
      <InstancePort>81</InstancePort>
    </Listener>
  </member>
</ListenerDescriptions>
<Instances>
  <member>
    <InstanceId>i-deadbeef</InstanceId>
  </member>
  <member>
    <InstanceId>i-beeff00d</InstanceId>
  </member>
</Instances>
<Policies>
  <AppCookieStickinessPolicies/>
  <OtherPolicies/>
  <LBCookieStickinessPolicies>
    <member>
      <PolicyName>foo-vip-policy</PolicyName>
      <CookieExpirationPeriod>10800</CookieExpirationPeriod>
    </member>
  </LBCookieStickinessPolicies>
</Policies>
jimbrowne added a commit to jimbrowne/boto that referenced this issue May 16, 2012
Currently fails due to bug boto#755.  Should be enhanced to assert on
ELB listener policies once they are supported in the Listener
object.
jimbrowne added a commit to jimbrowne/boto that referenced this issue May 17, 2012
@jimbrowne
Copy link
Contributor Author

Unit test in a86845c now passes when patch in bbdce81 is applied.

jimbrowne added a commit to jimbrowne/boto that referenced this issue May 17, 2012
@jimbrowne
Copy link
Contributor Author

I found ec228f9 while examining the LoadBalancer objects for this bug.

@garnaat
Copy link
Member

garnaat commented May 29, 2012

Are you going to submit a pull request? It looks like you have a fix in your branch.

@jimbrowne
Copy link
Contributor Author

Doh! Thought I had. Just submitted one.

msabramo pushed a commit to msabramo/boto that referenced this issue Nov 28, 2012
Currently fails due to bug boto#755.  Should be enhanced to assert on
ELB listener policies once they are supported in the Listener
object.
msabramo pushed a commit to msabramo/boto that referenced this issue Nov 28, 2012
msabramo pushed a commit to msabramo/boto that referenced this issue Nov 28, 2012
@jimbrowne
Copy link
Contributor Author

This was merged by #788

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants