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

Add protocol to rackspace lb extra #45

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libcloud/loadbalancer/drivers/rackspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ def _to_balancer(self, el):
"ipv4PrivateSource": sourceAddresses.get("ipv4Servicenet"),
}

if 'protocol' in el:
extra["protocol"] = el["protocol"]

if 'algorithm' in el and el["algorithm"] in self._VALUE_TO_ALGORITHM_MAP:
extra["algorithm"] = self._value_to_algorithm(el["algorithm"])

Expand Down
4 changes: 4 additions & 0 deletions test/loadbalancer/test_rackspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ def test_get_balancer_algorithm(self):
balancer = self.driver.get_balancer(balancer_id='8290')
self.assertEquals(balancer.extra["algorithm"], Algorithm.RANDOM)

def test_get_balancer_protocol(self):
balancer = self.driver.get_balancer(balancer_id='94695')
self.assertEquals(balancer.extra["protocol"], "HTTP")

def test_get_balancer_weighted_round_robin_algorithm(self):
balancer = self.driver.get_balancer(balancer_id='94692')
self.assertEquals(balancer.extra["algorithm"],
Expand Down