summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-06-28 03:32:07 +0000
committerGerrit Code Review <review@openstack.org>2016-06-28 03:32:08 +0000
commitd5499a54674b370b7dfc5c3fb951bba340d9a7d2 (patch)
tree4696482c786dfe17053868a1ed33f3de0c9e5f33
parent6fa1f889c3262eec4f2e4ae786df815b541189ba (diff)
parent721b526b87cdf9635752a7c058369ec501480e48 (diff)
downloadpython-neutronclient-stable/liberty.tar.gz
Merge "Fixed connection_limit and added UT" into stable/libertyliberty-eolstable/liberty
-rw-r--r--neutronclient/neutron/v2_0/lb/v2/listener.py5
-rw-r--r--neutronclient/tests/unit/lb/v2/test_cli20_listener.py10
2 files changed, 10 insertions, 5 deletions
diff --git a/neutronclient/neutron/v2_0/lb/v2/listener.py b/neutronclient/neutron/v2_0/lb/v2/listener.py
index 46afc50..8dd2359 100644
--- a/neutronclient/neutron/v2_0/lb/v2/listener.py
+++ b/neutronclient/neutron/v2_0/lb/v2/listener.py
@@ -56,7 +56,8 @@ class CreateListener(neutronV20.CreateCommand):
parser.add_argument(
'--connection-limit',
help=_('The maximum number of connections per second allowed for '
- 'the vip. Positive integer or -1 for unlimited (default).'))
+ 'the vip. Positive integer or -1 for unlimited (default).'),
+ type=int)
parser.add_argument(
'--description',
help=_('Description of the listener.'))
@@ -104,7 +105,7 @@ class CreateListener(neutronV20.CreateCommand):
}
neutronV20.update_dict(parsed_args, body[self.resource],
- ['connection-limit', 'description',
+ ['connection_limit', 'description',
'loadbalancer_id', 'name',
'default_tls_container_ref',
'sni_container_refs',
diff --git a/neutronclient/tests/unit/lb/v2/test_cli20_listener.py b/neutronclient/tests/unit/lb/v2/test_cli20_listener.py
index 6ecac35..f4fca1d 100644
--- a/neutronclient/tests/unit/lb/v2/test_cli20_listener.py
+++ b/neutronclient/tests/unit/lb/v2/test_cli20_listener.py
@@ -49,17 +49,21 @@ class CLITestV20LbListenerJSON(test_cli20.CLITestV20Base):
loadbalancer = 'loadbalancer'
protocol = 'TCP'
protocol_port = '80'
+ connection_limit = 10
def_tls_cont_ref = '11111'
args = ['--admin-state-down',
'--protocol', protocol, '--protocol-port', protocol_port,
'--loadbalancer', loadbalancer,
'--default-tls-container-ref', def_tls_cont_ref,
- '--sni-container-refs', '1111', '2222', '3333']
+ '--sni-container-refs', '1111', '2222', '3333',
+ '--connection-limit', '10']
position_names = ['admin_state_up',
'protocol', 'protocol_port', 'loadbalancer_id',
- 'default_tls_container_ref', 'sni_container_refs']
+ 'default_tls_container_ref', 'sni_container_refs',
+ 'connection_limit']
position_values = [False, protocol, protocol_port, loadbalancer,
- def_tls_cont_ref, ['1111', '2222', '3333']]
+ def_tls_cont_ref, ['1111', '2222', '3333'],
+ connection_limit]
self._test_create_resource(resource, cmd, '', my_id, args,
position_names, position_values,
cmd_resource=cmd_resource)