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):
|
def get_tag_limits(self):
|
||||||
try:
|
try:
|
||||||
result = self.client.url_get('spec/vmware/types/Tag')
|
result = self.client.url_get('spec/vmware/types/Tag')
|
||||||
scope_length = result['properties']['scope']['maxLength']
|
scope_length = result['properties']['scope'].get(
|
||||||
tag_length = result['properties']['tag']['maxLength']
|
'maxLength', utils.MAX_RESOURCE_TYPE_LEN)
|
||||||
|
tag_length = result['properties']['tag'].get(
|
||||||
|
'maxLength', utils.MAX_TAG_LEN)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.error("Unable to read tag limits. Reason: %s", e)
|
LOG.error("Unable to read tag limits. Reason: %s", e)
|
||||||
scope_length = utils.MAX_RESOURCE_TYPE_LEN
|
scope_length = utils.MAX_RESOURCE_TYPE_LEN
|
||||||
|
|||||||
Reference in New Issue
Block a user