-
Notifications
You must be signed in to change notification settings - Fork 41
Description
Background:
- Python 3.6
- ACI Fabric version 5.2.
- ACI Cobra-5.2.4.0.4 packages downloaded from one of my APICs.
Using The MoDirectory
class, I am able to retrieve fvTenant
Managed Objects from my Fabric.
However attempting to access any child container of an fvTenant
object created with MoDirectory.search_by_class()
or MoDirectory.lookupByDn()
triggers the following error:
>>> aci._ACI_MO_DIR.lookupByDn('uni/tn-Tenant503')
<cobra.modelimpl.fv.tenant.Tenant object at 0x7fabd848dd68>
>>> aci._ACI_MO_DIR.lookupByDn('uni/tn-Tenant503').BD
File ".../venv-cobra5.2/lib/python3.6/site-packages/cobra/model/init.py", line 29, in getattr
raise AttributeError("'module' object has no attribute '{0}'".format(className))
AttributeError: 'module' object has no attribute 'NLBStatsAg1h'
According to the APIC MIM Reference, NLBStatsAg1h
is a valid ACI Class so Cobra should not be throwing errors while trying to deserialize it into a Python object.
cloud:NLBStatsAg1h
General
Class Label: NLBStatsAg1h
Description: A class that represents the most current aggregated statistics for NLB front end stats in a 1 hour sampling interval. This class updates every 15 minutes.
Type: regular
Class Id: 17901
Encrypted: False
Inheritance: -
Access
Configurable: False
Createable Deleteable: never
Write Access: N/A
Read Access: admin
Full Traceback (most recent call last):
File ".../venv-cobra5.2/lib/python3.6/site-packages/cobra/mit/mo.py", line 100, in getattr
return BaseMo.getattr(self, propName)
File ".../venv-cobra5.2/lib/python3.6/site-packages/cobra/internal/base/moimpl.py", line 379, in getattr
return self.__children._getChildContainer(attrName)
File ".../venv-cobra5.2/lib/python3.6/site-packages/cobra/internal/base/moimpl.py", line 244, in _getChildContainer
for childClass in self._classMeta.childClasses:
File ".../venv-cobra5.2/lib/python3.6/site-packages/cobra/mit/meta.py", line 211, in next
return self._container[nextClassName]
File ".../venv-cobra5.2/lib/python3.6/site-packages/cobra/mit/meta.py", line 229, in getitem
klass = ClassLoader.loadClass(className)
File ".../venv-cobra5.2/lib/python3.6/site-packages/cobra/mit/_loader.py", line 17, in loadClass
return getattr(module, className)
File ".../venv-cobra5.2/lib/python3.6/site-packages/cobra/model/init.py", line 29, in getattr
raise AttributeError("'module' object has no attribute '{0}'".format(className))
AttributeError: 'module' object has no attribute 'NLBStatsAg1h'