04-30-2021 04:08 AM
Hi
[1] I was able to SSH to 10.10.20.110 and 10.10.20.113 (the 2 UCS manager sandbox IP addresses) via Cisco AnyConnect.
[2] But the following python script does not work.
from ucsmsdk.ucshandle import UcsHandle HANDLE = UcsHandle("10.10.20.110", "ucspe", "ucspe") or HANDLE = UcsHandle("10.10.20.110", "admin", "ciscopsdt") # Login into Cisco UCS Manager HANDLE.login()
the error message is
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\david.smith\AppData\Local\Programs\Python\Python39\lib\site-packages\ucsmsdk\ucshandle.py", line 135, in login
return self._login(auto_refresh, force, timeout=timeout)
File "C:\Users\david.smith\AppData\Local\Programs\Python\Python39\lib\site-packages\ucsmsdk\ucssession.py", line 599, in _login
response = self.post_elem(elem, timeout=timeout)
File "C:\Users\david.smith\AppData\Local\Programs\Python\Python39\lib\site-packages\ucsmsdk\ucssession.py", line 318, in post_elem
response = xc.from_xml_str(response_str, self)
File "C:\Users\david.smith\AppData\Local\Programs\Python\Python39\lib\site-packages\ucsmsdk\ucsxmlcodec.py", line 98, in from_xml_str
response.from_xml(root_elem, handle)
File "C:\Users\david.smith\AppData\Local\Programs\Python\Python39\lib\site-packages\ucsmsdk\ucsmethod.py", line 143, in from_xml
child_elems = elem.getchildren()
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'
Anyone knows why?
thanks
Patrick
Solved! Go to Solution.
04-30-2021 10:35 PM
Thanks @bigevilbeard:
I uninstalled Python 3.9.4 and installed 3.7.3 and the same script worked on 3.7.3
You can close the case. Thanks for help.
Sincerely,
Patrick
04-30-2021 04:57 AM
Hello, this isn't a fault with the sandbox, this looks like the version of python you are using is not supported (Python 3.9 incompatibilities). I would suggest, trying this with another Python (3.4 is listed as working) version or creating an issue on the repo https://github.com/CiscoUcs/ucsm_apis - I see there is further support via a slack room, details are here https://pypi.org/project/ucsmsdk/
Hope this helps.
04-30-2021 10:35 PM
Thanks @bigevilbeard:
I uninstalled Python 3.9.4 and installed 3.7.3 and the same script worked on 3.7.3
You can close the case. Thanks for help.
Sincerely,
Patrick
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