Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mo context not found for uni #117

Open
alok806 opened this issue Dec 22, 2015 · 3 comments
Open

mo context not found for uni #117

alok806 opened this issue Dec 22, 2015 · 3 comments

Comments

@alok806
Copy link

alok806 commented Dec 22, 2015

New tenant creation fails with the following error:

(brazos)ALWADHWA-M-K0E2:aryaCobra alwadhwa$ ./createBlankTenant.py
<?xml version="1.0" encoding="UTF-8"?>
<polUni status='created,modified'><fvTenant ownerKey='' name='Student1_lab' descr='' status='created,modified' ownerTag=''></fvTenant></polUni>
Traceback (most recent call last):
File "./createBlankTenant.py", line 27, in <module>
c.addMo(topMo)
File "/Users/alwadhwa/brazos/lib/python2.7/site-packages/acicobra-1.2_1i-py2.7.egg/cobra/mit/request.py", line 777, in addMo
raise ValueError('mo context not found for {0}'.format(str(mo.dn))) ValueError: mo context not found for uni

Cobra generated script

.. snip ..
topMo = cobra.model.pol.Uni('')

# build the request using cobra syntax
fvTenant = cobra.model.fv.Tenant(topMo, name='Student1_lab')

# commit the generated code to APIC
print toXMLStr(topMo)
c = cobra.mit.request.ConfigRequest()
c.addMo(topMo)
md.commit(c)

Workaround

c.addMo(fvTenant)

Version 1.2(1i)

>>> import cobra
>>> print cobra.__file__
/Users/alwadhwa/brazos/lib/python2.7/site-packages/acicobra-1.2_1i-py2.7.egg/cobra/__init__.pyc
>>>

@cciechaz
Copy link

cciechaz commented Apr 4, 2016

Same issue on later code:

import cobra
print cobra.file
C:\Python27\lib\site-packages\acimodel-1.2_2g-py2.7.egg\cobra__init__.pyc

Workaround works ok.

@bashfaq
Copy link

bashfaq commented Apr 28, 2016

**** Experienced this issue at NetApp deployment ****

python add_phys_domain.py
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:769: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)


Traceback (most recent call last):
File "add_phys_domain.py", line 26, in
c.addMo(polUni)
File "/usr/lib/python2.7/site-packages/acicobra-1.2_2g-py2.7.egg/cobra/mit/request.py", line 777, in addMo
raise ValueError('mo context not found for {0}'.format(str(mo.dn)))
ValueError: mo context not found for uni

Applied the following work around which appeared to work.

Replace:

c.addMo(polUni)

to

c.addMo(physDomP)

@tigelane
Copy link

Found another one that needed the work around.
1.2_1k-py2.7.egg

c.addMo(infraInfra)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants