Merge "Allow subnet name in lb-vip-create and lb-pool-create"
This commit is contained in:
commit
8218cd1f26
|
@ -73,14 +73,17 @@ class CreatePool(quantumv20.CreateCommand):
|
|||
help='the subnet on which the members of the pool will be located')
|
||||
|
||||
def args2body(self, parsed_args):
|
||||
_subnet_id = quantumv20.find_resourceid_by_name_or_id(
|
||||
self.get_client(), 'subnet', parsed_args.subnet_id)
|
||||
body = {
|
||||
self.resource: {
|
||||
'admin_state_up': parsed_args.admin_state,
|
||||
'subnet_id': _subnet_id,
|
||||
},
|
||||
}
|
||||
quantumv20.update_dict(parsed_args, body[self.resource],
|
||||
['description', 'lb_method', 'name',
|
||||
'subnet_id', 'protocol', 'tenant_id'])
|
||||
'protocol', 'tenant_id'])
|
||||
return body
|
||||
|
||||
|
||||
|
|
|
@ -85,16 +85,19 @@ class CreateVip(quantumv20.CreateCommand):
|
|||
def args2body(self, parsed_args):
|
||||
_pool_id = quantumv20.find_resourceid_by_name_or_id(
|
||||
self.get_client(), 'pool', parsed_args.pool_id)
|
||||
_subnet_id = quantumv20.find_resourceid_by_name_or_id(
|
||||
self.get_client(), 'subnet', parsed_args.subnet_id)
|
||||
body = {
|
||||
self.resource: {
|
||||
'pool_id': _pool_id,
|
||||
'admin_state_up': parsed_args.admin_state,
|
||||
'subnet_id': _subnet_id,
|
||||
},
|
||||
}
|
||||
quantumv20.update_dict(parsed_args, body[self.resource],
|
||||
['address', 'connection_limit', 'description',
|
||||
'name', 'protocol_port', 'protocol',
|
||||
'subnet_id', 'tenant_id'])
|
||||
'tenant_id'])
|
||||
return body
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue