cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements


        IMPORTANT! The sandboxes that can be reserved will be undergoing maintenance
from 12:01AM PDT Friday May 21 until 11:59PM Sunday May 23.
During this time, reserved sandboxes will be unavailable.
Always-On sandboxes are not affected and should still be available.
198
Views
0
Helpful
2
Replies
a11024
Beginner

could not login to UCS manager sandbox using UCS Python SDK

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

2 REPLIES 2
bigevilbeard
Cisco Employee

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.

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

View solution in original post

Content for Community-Ad