get_configlets should not run get_configlet_by_name for each configlet
noredistribution opened this issue · 1 comments
Seems like there was a bug at some point on the CV side due to which the content of the configlets were not getting added to the result when calling getConfiglets.do so to work around it we've used getConfigletByName.do
and added the config
to each configlet in the dictionary:
if self.clnt.apiversion == 1.0:
self.log.debug('v1 Inventory API Call')
return configlets
else:
self.log.debug('v2 Inventory API Call')
# New API getConfiglets does not return the actual configlet config
# Get the actual configlet config using getConfigletByName
if 'data' in configlets:
for configlet in configlets['data']:
full_cfglt_data = self.get_configlet_by_name(
configlet['name'])
configlet['config'] = full_cfglt_data['config']
return configlets
I've checked 2018.2.5, 2019.1.4, 2020.1.1, 2021.1.1, 2021.2.2, 2021.3.0 and CVaaS and getConfiglets.do works fine and has the config key with the full config, so we should remove this condition or add another condition that it works fine with v3+ aka 2019.1.0+ (to me it worked even with v2, at least with the latest version which is 2018.2.5)
this operation makes the call very slow at scale and instead of a few seconds it can take several minutes to get the final result back