Fix debugging and Galera support
Fix debugging for newer python-novaclient versions Also add support for the Galera protocol option Change-Id: I84f65d659e9699f26566745b18d868280dc15918
This commit is contained in:
@@ -95,7 +95,9 @@ Create a load balancer
|
|||||||
|
|
||||||
.. option:: --protocol <protocol>
|
.. option:: --protocol <protocol>
|
||||||
|
|
||||||
The protocol type for the load balancer (HTTP or TCP)
|
The protocol type for the load balancer (HTTP, TCP or GALERA).
|
||||||
|
The Galera option adds support for deadlock avoidance in Galera clusters,
|
||||||
|
see `Serveral Nine's Blog <http://www.severalnines.com/blog/avoiding-deadlocks-galera-set-haproxy-single-node-writes-and-multi-node-reads>`_ on this.
|
||||||
|
|
||||||
.. option:: --node <ip:port>
|
.. option:: --node <ip:port>
|
||||||
|
|
||||||
|
@@ -90,7 +90,7 @@ class ClientOptions(object):
|
|||||||
help='port for the load balancer, 80 is default')
|
help='port for the load balancer, 80 is default')
|
||||||
sp.add_argument('--protocol',
|
sp.add_argument('--protocol',
|
||||||
help='protocol for the load balancer, HTTP is default',
|
help='protocol for the load balancer, HTTP is default',
|
||||||
choices=['HTTP', 'TCP'])
|
choices=['HTTP', 'TCP', 'GALERA'])
|
||||||
sp.add_argument('--algorithm',
|
sp.add_argument('--algorithm',
|
||||||
help='algorithm for the load balancer,'
|
help='algorithm for the load balancer,'
|
||||||
' ROUND_ROBIN is default',
|
' ROUND_ROBIN is default',
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
import prettytable
|
import prettytable
|
||||||
import novaclient
|
import novaclient
|
||||||
import socket
|
import socket
|
||||||
|
import logging
|
||||||
|
|
||||||
from novaclient import client
|
from novaclient import client
|
||||||
|
|
||||||
@@ -59,6 +60,10 @@ novaclient.exceptions.from_response = from_response
|
|||||||
|
|
||||||
class LibraAPI(object):
|
class LibraAPI(object):
|
||||||
def __init__(self, args):
|
def __init__(self, args):
|
||||||
|
if args.debug:
|
||||||
|
logger = logging.getLogger()
|
||||||
|
logger.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
self.nova = client.HTTPClient(
|
self.nova = client.HTTPClient(
|
||||||
args.os_username,
|
args.os_username,
|
||||||
args.os_password,
|
args.os_password,
|
||||||
|
Reference in New Issue
Block a user