Trying to split into a dictionary:
output = "Port WWN" : 10:00:00:00:xx:xx:xx:01 ,
"Node WWN" : 20:00:00:00:xx:xx:xx:01
tried:
d = dict(x.split(": ") for x in output.split("\n"))
print(d)
expected output =
{Port WWN : 10:00:00:00:xx:xx:xx:01, Node WWN : 20:00:00:00:xx:xx:xx:01}
getting error:
File "/Users/mike/PycharmProject/pyTest/venv/scratch.py", line 6, in <module>
d = dict(x.split("=") for x in output.split("\n"))
ValueError: dictionary update sequence element #0 has length 1; 2 is required