Skip to content

Add policy management methods to the ELB driver - #253

Closed
fluffybeing wants to merge 3 commits into
apache:trunkfrom
fluffybeing:loadbalancerpolicy
Closed

fluffybeing wants to merge 3 commits into
apache:trunkfrom
fluffybeing:loadbalancerpolicy

Conversation

@fluffybeing

Copy link
Copy Markdown

@Kami I am not able to debug the elb.py individually. I have followed the testing guidlines from the official documentation.

P.S. From now onward i will create pull request after i have made few changes. I am not used to it, because in fedora community we used to discuss things on fpaste and then create pr.

Rahul Ranjan added 2 commits February 19, 2014 17:21
added test suite for the ex_rename() extention method

changed ex_rename() to ex_rename_node() extention method

Added the MockHttptestcase from ex_rename_node() extension method

changed ex_rename() to ex_rename_node() extention method

corrected the MockHttptestcase for ex_rename_node() method

Added a fixture for ex_rename_node() method
Comment thread libcloud/loadbalancer/drivers/elb.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method returns a list so it should have a plural name (policy -> policies).

Please also add a docstring which documents what the method does and what it returns.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was using doc string initially but found that no other methods have and so I removed them. Now I will add them.

@Kami

Kami commented Feb 23, 2014

Copy link
Copy Markdown
Member

@rahulrrixe I'm not sure exactly what you mean with "I am not able to debug the elb.py individually".

You don't have an AWS account? Or is it something else?

Comment thread libcloud/loadbalancer/drivers/elb.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here (plural name).

@Kami

Kami commented Feb 23, 2014

Copy link
Copy Markdown
Member

To make this useful, we also need to implement SetLoadBalancerPoliciesOfListener method (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/API_SetLoadBalancerPoliciesOfListener.html).

This method actually applies a policy to the load balancer.

From the article:

elb-create-lb-policy  myELBName        \
  --policy-type SSLNegotiationPolicyType \
  --policy-name=mySSLPolicyName        \
  --attribute "name=Reference-Security-Policy, value=ELBSecurityPolicy-2014-01"

$ elb-set-lb-policies-of-listener  myELBName \
  --lb-port 443 \
  --policy-names mySSLPolicyName,[PolicyName2,...]

@fluffybeing

Copy link
Copy Markdown
Author

@Kami Thanks I will make the required changes.

regarding debugging I have fixed everything and its working fine and now working on writing test suits.

@fluffybeing

Copy link
Copy Markdown
Author

@Kami I have checked all the methods with the aws instance and they all are working fine.

Comment thread libcloud/loadbalancer/drivers/elb.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting those empty lines breaks lint (pep8 step) - https://travis-ci.org/apache/libcloud/jobs/19573774

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kami I will take care of it in future.

@Kami

Kami commented Feb 25, 2014

Copy link
Copy Markdown
Member

There are still lint and test failures btw - https://travis-ci.org/apache/libcloud/builds/19573773

Comment thread libcloud/loadbalancer/drivers/elb.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer this item to return a new params list instead of mutate params argument in place.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please make this a "private" method and move it to the end of the class.

@fluffybeing

Copy link
Copy Markdown
Author

@Kami I have made all the changes that you have suggested and also written test suits for the newly added extension methods. I am getting lint failure at some places, will fix them soon.

Can you give me your feedback on these changes?

Comment thread libcloud/loadbalancer/drivers/elb.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

balancer_port should probably be port to be consistent with other methods.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kami balancer_port I have given specifically in the method to differentiate it from instance_port

@Kami

Kami commented Feb 26, 2014

Copy link
Copy Markdown
Member

It would also be good to add some documentation and examples of how to use that.

Adding an example for common scenario like creating a listener and setting a policy for SSL would be good.

@fluffybeing

Copy link
Copy Markdown
Author

@Kami I will add the documentation for the examples and also update different docstring's.

@Kami

Kami commented Feb 26, 2014

Copy link
Copy Markdown
Member

Just want to make sure we are both on the same page.

I meant adding documentation and examples to docs/loadbalancer/drivers/elb.rst :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants