NSXv3: Limit tag value to maximum 40

NSXv3 tag value has a mamximum lenght of 40. Limit tag value to
the maximum when the tag exceeds the maximum.

Change-Id: I339ccb331ad3a01233e5ab81db4ebf3a75fd2ed0
This commit is contained in:
Tong Liu 2017-10-31 13:11:32 +08:00
parent 67a3761498
commit ff6daea327

View File

@ -48,7 +48,7 @@ class EdgeListenerManager(base_mgr.Nsxv3LoadbalancerBaseManager):
listener.tenant_id,
context.project_name)
tags.append({'scope': 'os-lbaas-lb-name',
'tag': listener.loadbalancer.name[:255]})
'tag': listener.loadbalancer.name[:utils.MAX_TAG_LEN]})
tags.append({'scope': 'os-lbaas-lb-id',
'tag': lb_id})
if listener.protocol == 'HTTP' or listener.protocol == 'HTTPS':