Fix get_tag_limits to be more careful
Change-Id: If52cc779b1c793caa3f180114a7428b43486e2b5
This commit is contained in:
@@ -269,8 +269,10 @@ class NsxLibBase(object):
|
||||
def get_tag_limits(self):
|
||||
try:
|
||||
result = self.client.url_get('spec/vmware/types/Tag')
|
||||
scope_length = result['properties']['scope']['maxLength']
|
||||
tag_length = result['properties']['tag']['maxLength']
|
||||
scope_length = result['properties']['scope'].get(
|
||||
'maxLength', utils.MAX_RESOURCE_TYPE_LEN)
|
||||
tag_length = result['properties']['tag'].get(
|
||||
'maxLength', utils.MAX_TAG_LEN)
|
||||
except Exception as e:
|
||||
LOG.error("Unable to read tag limits. Reason: %s", e)
|
||||
scope_length = utils.MAX_RESOURCE_TYPE_LEN
|
||||
|
||||
Reference in New Issue
Block a user