vmware / nsx-powerops

NSX-v Operationalization project. Automate Networking Documentation and HealthCheck.
Other
70 stars 34 forks source link

Exception when creating documentation set #128

Open ysi opened 3 years ago

ysi commented 3 years ago

Hi,

When I want to create a documentation sert (menu 1 and 5), script crash at Generating Tier-1 Forwarding Tables level.

Traceback (most recent call last): File "_poweropsmain.py", line 566, in main() File "_poweropsmain.py", line 563, in main action() File "_poweropsmain.py", line 225, in opt_docs action() File "_poweropsmain.py", line 295, in doc_set docs_tier1_forwardingtables.main() File "/Users/ysimonet/Documents/Scripts/NSX/Python/powerops/NSX-T-PowerOps/lib/powerops_master/nsx-powerops/basic/docs_tier1_forwardingtables.py", line 106, in main sheet = t1_routing_wkbk.add_sheet(str(i), cell_overwrite_ok=True) File "/usr/local/lib/python3.8/site-packages/xlwt/Workbook.py", line 368, in add_sheet raise Exception("invalid worksheet name %r" % sheetname) Exception: invalid worksheet name '21452d08-f591-416f-bead-112d6c25ad95'

It seems that you use UUID as name sheet with python module "xlwt". UUID seems too long for a sheet name. In Excel itself it's working but with xlwt, name of sheet must not exceeded 32 caracters. If I replace in docs_tier1_forwardingtables.py line 89 t1_id_list.append(i['id']) by t1_id_list.append(i['display_name']), it seems working.

[EDIT] : On Mac OS with 3.8 python version

stephen-sauer commented 3 years ago

branch:T-OPS

Hi,

When I want to create a documentation sert (menu 1 and 5), script crash at Generating Tier-1 Forwarding Tables level.

Traceback (most recent call last): File "_poweropsmain.py", line 566, in main() File "_poweropsmain.py", line 563, in main action() File "_poweropsmain.py", line 225, in opt_docs action() File "_poweropsmain.py", line 295, in doc_set docs_tier1_forwardingtables.main() File "/Users/ysimonet/Documents/Scripts/NSX/Python/powerops/NSX-T-PowerOps/lib/powerops_master/nsx-powerops/basic/docs_tier1_forwardingtables.py", line 106, in main sheet = t1_routing_wkbk.add_sheet(str(i), cell_overwrite_ok=True) File "/usr/local/lib/python3.8/site-packages/xlwt/Workbook.py", line 368, in add_sheet raise Exception("invalid worksheet name %r" % sheetname) Exception: invalid worksheet name '21452d08-f591-416f-bead-112d6c25ad95'

It seems that you use UUID as name sheet with python module "xlwt". UUID seems too long for a sheet name. In Excel itself it's working but with xlwt, name of sheet must not exceeded 32 caracters. If I replace in docs_tier1_forwardingtables.py line 89 t1_id_list.append(i['id']) by t1_id_list.append(i['display_name']), it seems working.

branch:T-OPS