New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ELB parsing broken when listeners have applied policies #755

Open
jimbrowne opened this Issue May 16, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@jimbrowne
Contributor

jimbrowne commented May 16, 2012

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

Unit test that checks proper parsing of ELB listeners
Currently fails due to bug #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

This comment has been minimized.

Show comment
Hide comment
@jimbrowne

jimbrowne May 17, 2012

Contributor

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

Contributor

jimbrowne commented May 17, 2012

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

This comment has been minimized.

Show comment
Hide comment
@jimbrowne

jimbrowne May 17, 2012

Contributor

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

Contributor

jimbrowne commented May 17, 2012

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

@garnaat

This comment has been minimized.

Show comment
Hide comment
@garnaat

garnaat May 29, 2012

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@jimbrowne

jimbrowne May 29, 2012

Contributor

Doh! Thought I had. Just submitted one.

Contributor

jimbrowne commented May 29, 2012

Doh! Thought I had. Just submitted one.

msabramo pushed a commit to msabramo/boto that referenced this issue Nov 28, 2012

Unit test that checks proper parsing of ELB listeners
Currently fails due to bug #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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment