Make all monitoring params required. Otherwise it sets
everything back to defaults. Change-Id: I788e6d14cd3136c305a476c5680ec6f781bd506d
This commit is contained in:
parent
4b15e6ece9
commit
645e6042c2
@ -66,8 +66,8 @@ class LoadBalancer(Resource):
|
||||
def delete_node(self, node):
|
||||
return self.manager.delete_node(self, node)
|
||||
|
||||
def update_monitor(self, type_='CONNECT', delay=30, timeout=30,
|
||||
attempts=2, path=None):
|
||||
def update_monitor(self, type_, delay, timeout,
|
||||
attempts, path=None):
|
||||
return self.manager.update_monitor(
|
||||
self, type_=type_, delay=delay, timeout=timeout, attempts=attempts,
|
||||
path=path)
|
||||
@ -257,8 +257,8 @@ class LoadBalancerManager(Manager):
|
||||
url = '/loadbalancers/%s/healthmonitor' % getid(lb)
|
||||
return self._get(url, obj_class=Monitor)
|
||||
|
||||
def update_monitor(self, lb, type_='CONNECT', delay=30, timeout=30,
|
||||
attempts=2, path=None):
|
||||
def update_monitor(self, lb, type_, delay, timeout,
|
||||
attempts, path=None):
|
||||
"""
|
||||
Update a Monitor in a LoadBalancer
|
||||
|
||||
@ -272,7 +272,7 @@ class LoadBalancerManager(Manager):
|
||||
data = {}
|
||||
data['type'] = type_
|
||||
if timeout > delay:
|
||||
raise ValueError('Timeout can\'t be greater then Delay')
|
||||
raise ValueError('Timeout can\'t be greater than Delay')
|
||||
data['delay'] = delay
|
||||
data['timeout'] = timeout
|
||||
data['attemptsBeforeDeactivation'] = attempts
|
||||
|
@ -246,26 +246,22 @@ def do_monitor_show(cs, args):
|
||||
@cliutils.arg(
|
||||
'--type',
|
||||
choices=['CONNECT', 'HTTP'],
|
||||
default='CONNECT',
|
||||
help='health monitor type')
|
||||
help='health monitor type', required=True)
|
||||
@cliutils.arg(
|
||||
'--delay',
|
||||
type=int,
|
||||
default=30,
|
||||
metavar='SECONDS',
|
||||
help='time between health monitor calls')
|
||||
help='time between health monitor calls', required=True)
|
||||
@cliutils.arg(
|
||||
'--timeout',
|
||||
type=int,
|
||||
default=30,
|
||||
metavar='SECONDS',
|
||||
help='time to wait before monitor times out')
|
||||
help='time to wait before monitor times out', required=True)
|
||||
@cliutils.arg(
|
||||
'--attempts',
|
||||
type=int,
|
||||
default=2,
|
||||
metavar='COUNT',
|
||||
help='connection attempts before marking node as bad')
|
||||
help='connection attempts before marking node as bad', required=True)
|
||||
@cliutils.arg(
|
||||
'--path',
|
||||
help='URI path for health check')
|
||||
|
Loading…
x
Reference in New Issue
Block a user