Skip to content

Commit

Permalink
Allow subnet name in lb-vip-create and lb-pool-create
Browse files Browse the repository at this point in the history
Fix bug 1168998

Change-Id: I25bf357d069b99db467db43900d293f30c2a7d30
  • Loading branch information
amotoki committed Jun 16, 2013
1 parent 92d9698 commit 1a17997
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion quantumclient/quantum/v2_0/lb/pool.py
Expand Up @@ -73,14 +73,17 @@ def add_known_arguments(self, parser):
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


Expand Down
5 changes: 4 additions & 1 deletion quantumclient/quantum/v2_0/lb/vip.py
Expand Up @@ -85,16 +85,19 @@ def add_known_arguments(self, parser):
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


Expand Down

0 comments on commit 1a17997

Please sign in to comment.