From e5e815ccc1ed7a7971d38893b0d5117c2d97ddf4 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Sat, 21 Feb 2015 00:15:25 +0000 Subject: [PATCH] Fix lbaas-loadbalancer-create with no --name This fix allows creating load balancers with no name specified on the command line per the LBaaS v2 API specification. Change-Id: Ia9134fab7799576eb4782b04e30112ea0f622e64 --- neutronclient/neutron/v2_0/lb/v2/loadbalancer.py | 4 ++-- neutronclient/tests/unit/lb/v2/test_cli20_loadbalancer.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/neutronclient/neutron/v2_0/lb/v2/loadbalancer.py b/neutronclient/neutron/v2_0/lb/v2/loadbalancer.py index 576c5fa5a..49fd13451 100644 --- a/neutronclient/neutron/v2_0/lb/v2/loadbalancer.py +++ b/neutronclient/neutron/v2_0/lb/v2/loadbalancer.py @@ -69,13 +69,13 @@ class CreateLoadBalancer(neutronV20.CreateCommand): self.get_client(), 'subnet', parsed_args.vip_subnet) body = { self.resource: { - 'name': parsed_args.name, 'vip_subnet_id': _subnet_id, 'admin_state_up': parsed_args.admin_state, }, } neutronV20.update_dict(parsed_args, body[self.resource], - ['description', 'provider', 'vip_address']) + ['description', 'provider', 'vip_address', + 'name']) return body diff --git a/neutronclient/tests/unit/lb/v2/test_cli20_loadbalancer.py b/neutronclient/tests/unit/lb/v2/test_cli20_loadbalancer.py index a8ccd4e7e..11bed0317 100644 --- a/neutronclient/tests/unit/lb/v2/test_cli20_loadbalancer.py +++ b/neutronclient/tests/unit/lb/v2/test_cli20_loadbalancer.py @@ -32,9 +32,9 @@ class CLITestV20LbLoadBalancerJSON(test_cli20.CLITestV20Base): name = 'lbaas-loadbalancer-name' vip_subnet_id = 'vip-subnet' my_id = 'my-id' - args = ['--name', name, vip_subnet_id] - position_names = ['name', 'vip_subnet_id'] - position_values = [name, vip_subnet_id] + args = [vip_subnet_id] + position_names = ['vip_subnet_id'] + position_values = [vip_subnet_id] self._test_create_resource(resource, cmd, name, my_id, args, position_names, position_values, cmd_resource=cmd_resource)