Exemplo n.º 1
0
 def root(self):
     mos_and_types = utils.decompose_dn(self._aci_mo_name, self.dn)
     if mos_and_types:
         # Faults associated with unrecognized MOs will not decompose
         mo = apic_client.ManagedObjectClass(mos_and_types[0][0])
         return (mo.rn(mos_and_types[0][1])
                 if mo.rn_param_count else mo.rn())
Exemplo n.º 2
0
 def test_decompose_dn(self):
     dn = 'uni/tn-common/brc-p/subj-p/intmnl/rsfiltAtt-p'
     type = 'vzRsFiltAtt'
     self.assertEqual([('fvTenant', 'common'), ('vzBrCP', 'p'),
                       ('vzSubj', 'p'), ('vzInTerm', 'intmnl'),
                       ('vzRsFiltAtt', 'p')],
                      internal_utils.decompose_dn(type, dn))
 def test_decompose_dn(self):
     dn = 'uni/tn-common/brc-p/subj-p/intmnl/rsfiltAtt-p'
     type = 'vzRsFiltAtt'
     self.assertEqual(
         [('fvTenant', 'common'), ('vzBrCP', 'p'), ('vzSubj', 'p'),
          ('vzInTerm', 'intmnl'), ('vzRsFiltAtt', 'p')],
         internal_utils.decompose_dn(type, dn))
Exemplo n.º 4
0
 def root(self):
     mos_and_types = utils.decompose_dn(self._aci_mo_name, self.dn)
     mo = apic_client.ManagedObjectClass(mos_and_types[0][0])
     if mo.rn_param_count > 0:
         return mo.rn(mos_and_types[0][1])
     else:
         return mo.rn()
 def _dn_to_key(mo_type, dn):
     type_and_dn = utils.decompose_dn(mo_type, dn)
     return tuple([str('|'.join(x))
                   for x in type_and_dn]) if type_and_dn else None
 def _dn_to_key(mo_type, dn):
     type_and_dn = utils.decompose_dn(mo_type, dn)
     return tuple([str('|'.join(x))
                   for x in type_and_dn]) if type_and_dn else None