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

Libcloud 737 create dimension data load balancing driver #567

Conversation

tonybaloney
Copy link
Contributor

Created a dimension data driver for load balancing

placed proprietary logic into ex_methods
supported existing interfaces for LoadBalancer
moved common classes and the connection class used in compute into a common library
added unit tests and fixtures for the load balancer driver
updated the docs
tested against expected results and API docs

kwargs['region'] = self.selected_region
return kwargs

def create_balancer(self, name, port, protocol, algorithm, members):
Copy link
Member

Choose a reason for hiding this comment

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

Is members a required argument or you can create a load-balancer with no initial members and attach them later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't test that case of having members as None but technically you can create a virtual listener pool with no members. I'll add a check before it adds members to check members is not None and add a unit test for that scenario. 

On Sat, Aug 29, 2015 at 9:19 AM -0700, "Tomaz Muraus" notifications@github.com wrote:

In libcloud/loadbalancer/drivers/dimensiondata.py:

  •                                                port=port,
    
  •                                                api_version=api_version,
    
  •                                                region=region,
    
  •                                                **kwargs)
    
  • def _ex_connection_class_kwargs(self):
  •    """
    
  •        Add the region to the kwargs before the connection is instantiated
    
  •    """
    
  •    kwargs = super(DimensionDataLBDriver,
    
  •                   self)._ex_connection_class_kwargs()
    
  •    kwargs['region'] = self.selected_region
    
  •    return kwargs
    
  • def create_balancer(self, name, port, protocol, algorithm, members):

Is members a required argument or you can create a load-balancer with no initial members and attach them later?


Reply to this email directly or view it on GitHub.

Copy link
Member

Choose a reason for hiding this comment

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

Alright, thanks.

Besides that, it looks good to me.

… empty list of members, or a NoneType for the list of members. Also creating tests for the destroy instance methods and added docstrings.
@tonybaloney
Copy link
Contributor Author

Checked in updates and tests to support the use case you mentioned. Also added a few more tests and some docstrings for when the docs get generated

@Kami
Copy link
Member

Kami commented Aug 30, 2015

Thanks.

I thought that the base driver and standard API defaults members to None and makes it optional, but looks like that is not the case.

Imo, it makes sense to allow users to create load balancer without any initial members (e.g. you want to pre-allocate a balancer so you don't need to wait for the creation later on when you need it), so I will also go ahead and make the change in the base API as well.

@Kami
Copy link
Member

Kami commented Aug 30, 2015

I'm having issues (a bunch of merge conflicts) while trying to merge those changes into trunk.

Can you please synchronize your branch with the latest upstream trunk?

@tonybaloney
Copy link
Contributor Author

I must be missing something here, some scaffolding logic to add the new unit tests class to the general test suite. I was always running the tests directly.

@Kami
Copy link
Member

Kami commented Aug 30, 2015

You mean you are not sure why tests fail on Travis CI or something else?

I can look while merging it. Could be an issue with an import or similar.

@tonybaloney
Copy link
Contributor Author

I've done the sync upstream, merged into my fork, then the branch, so auto
merge should be good now, but travis is failing:

loadTestsFromName

parent, obj = obj, getattr(obj, part)

AttributeError: 'module' object has no attribute 'test_dimensiondata'

But, it exists..

https://github.com/DimensionDataCBUSydney/libcloud/blob/LIBCLOUD-737_Create_Dimension_Data_Load_Balancing_driver/libcloud/test/loadbalancer/test_dimensiondata.py

On Sun, Aug 30, 2015 at 10:08 PM, Tomaz Muraus notifications@github.com
wrote:

You mean you are not sure why tests fail on Travis CI or something else?

I can look while merging it. Could be an issue with an import or similar.


Reply to this email directly or view it on GitHub
#567 (comment).

@Kami
Copy link
Member

Kami commented Aug 30, 2015

@tonybaloney compute driver was the one causing failure. I've fixed the issue locally and will merge it shortly:

python libcloud/test/compute/test_dimensiondata.py
Traceback (most recent call last):
  File "libcloud/test/compute/test_dimensiondata.py", line 21, in <module>
    from libcloud.compute.drivers.dimensiondata import DimensionDataAPIException
ImportError: cannot import name DimensionDataAPIException

I will also look into the test loading code and see if it's possible to make it report more user-friendly errors.

@tonybaloney
Copy link
Contributor Author

We just reached the same conclusion. Threw me off having 2 test classes of the same name! Pushed and passing. It should be clear to merge now.

@asfgit asfgit closed this in c382e45 Aug 30, 2015
@Kami
Copy link
Member

Kami commented Aug 30, 2015

Merged, thanks!

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.

None yet

2 participants