01-28-2014 08:23 PM
Getting an error when trying to install 0.8 version. Already have 0.5 and dont know how to uninstall the older python packages.
getting following error:
Traceback (most recent call last):
File "setup.py", line 12, in <module>
from UcsSdk import __version__
ImportError: cannot import name __version__
01-29-2014 02:22 AM
Please delete the 'UcsSdk' directory and its contents under the 'dist-packages' folder of the python installation directory and then install v0.8.
01-29-2014 08:54 AM
This is a MAC. Is this not supported. I found my older UcsSdk files under /Libraries/Python/2.7/site-packages/.
Is that the right location. Seems like the setup.py is looking for __version__ module and there is nothing in the src or other directories that allows for that. Any help much appreciated.
jds
01-29-2014 09:27 AM
Figured it out....Need to kill the files in the first location as well as this location as well...Or at least that is what I did.
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
jds
01-29-2014 10:38 AM
I think the install worked but I now cannot access the UCS system via the python tool. I have the Python package installed on my Ubuntu system and that works....
Here is the issue I'm having now.
>>> from UcsSdk import *
>>> handle = UCSHandle()
Traceback (most recent call last):
File "<pyshell#11>", line 1, in <module>
handle = UCSHandle()
NameError: name 'UCSHandle' is not defined
>>> handle = UcsHandle()
>>> handle.Login('10.87.126.233','admin','password')
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
handle.Login('10.87.126.233','admin','password')
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/UcsSdk/UcsHandle.py", line 340, in Login
raise Exception('[Error]: Login : Connection to <%s> Failed' %(name))
Exception: [Error]: Login : Connection to <10.87.126.233> Failed
>>>
any help much appreciated
jds
01-30-2014 09:24 AM
As per the message, the python script is not able to establish a connection with UCSM. Are you able to launch the UCSM GUI from this machine where you are running the python script?
01-30-2014 09:34 AM
I can get to that GUI from the machine running Python....
01-30-2014 09:45 AM
Are you using https to launch the GUI? If no, then can you try using https? The Login API in the script uses HTTPS by default.
01-30-2014 11:13 AM
I am using HTTPS. It has to be something on my machine seeing a Ubuntu machine I have works just fine. The problem is that this did work(or at least the Login task did) with version 0.5 but I upgraded to 0.8 and maually removed files. Wondering if I deleted something I should not have. Just trying to understand what I could have done.
02-09-2014 08:00 PM
It appears that python 2.7.6 breaks the SDK. I've got two virtualenvs - one running 2.7.3 and the other running 2.7.6. My connections work fine with 2.7.3:
(VENV-ucsm)rohorner-mac:ucs rohorner$ python -V
Python 2.7.3
(VENV-ucsm)rohorner-mac:ucs rohorner$ python get_inv.py -u admin -p password -i 192.168.200.101
{'classId': 'LsbootDef', 'XtraProperty': {}, 'Dn': 'sys/rack-unit-1/boot-policy', 'handle': <ImcSdk.ImcHandle.ImcHandle instance at 0x101c64e18>, 'Name': 'boot-policy', 'RebootOnUpdate': 'no', 'propMoMeta': <ImcSdk.ImcHandle.ImcMoMeta instance at 0x1018bf3f8>, 'Status': None, 'dirtyMask': 7L, 'Purpose': 'operational', 'child': [], 'Rn': 'boot-policy', 'ChildAction': None}
But it breaks if I use 2.7.6:
(VENV-ucs)rohorner-mac:ucs rohorner$ python get_inv.py -u admin -p password -i 192.168.200.101
Exception: [Error]: Login : Connection to <192.168.200.101> Failed
------------------------------------------------------------
Traceback (most recent call last):
File "get_inv.py", line 11, in <module>
handle.Login(host_ip, user, password)
File "/Users/rohorner/python/ucs/VENV-ucs/lib/python2.7/site-packages/ImcSdk/ImcHandle.py", line 280, in Login
raise Exception('[Error]: Login : Connection to <%s> Failed' %(name))
Exception: [Error]: Login : Connection to <192.168.200.101> Failed
------------------------------------------------------------
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide