Skip to content
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

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

@jimbrowne 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
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

@jimbrowne 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
Copy link
Contributor Author

@jimbrowne jimbrowne commented May 17, 2012

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

@garnaat
Copy link
Member

@garnaat 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

@jimbrowne 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
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

@jimbrowne jimbrowne commented Feb 27, 2020

This was merged by #788

@jimbrowne jimbrowne closed this Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.