cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
701
Views
0
Helpful
0
Replies

Python SDK issues with import backup

lwatta
Cisco Employee
Cisco Employee

I'm getting the following on Linux and MacOS with 0.8.2 and 0.8.3

UCS backup xml template: <ucs-backup-xml-templ/UCS_mixpod_template_newcabling.xml>

Exception: 'COMPUTERNAME'

------------------------------------------------------------

Traceback (most recent call last):

  File "./import-backup-xml-tmpl.py", line 55, in main

    handle.ImportUcsBackup(path =xmlBackupFile, merge = True, dumpXml=True )

  File "/Library/Python/2.7/site-packages/UcsSdk/UcsHandle.py", line 1243, in ImportUcsBackup

    mgmtImporter.Hostname = os.environ['COMPUTERNAME'].lower() + datetime.now().strftime('%Y%m%d%H%M')

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py", line 23, in __getitem__

    raise KeyError(key)

KeyError: 'COMPUTERNAME'

------------------------------------------------------------

Why would anyone try to figure out the hostname using os.environ['COMPUTERNAME'] ??

Maybe on Windows but this method doesn't work for unix. Now I have to set COMPUTERNAME environment variable to get import to work.

0 Replies 0

Cisco UCS X-Series Energy Efficiency Offer