python-dlipower icon indicating copy to clipboard operation
python-dlipower copied to clipboard

NameError when `set_outlet_name` used with hyphen

Open DavidAntliff opened this issue 5 years ago • 0 comments

I expect dlipower set_outlet_name 1 foo-bar to set the outlet name to "foo-bar", but instead it throws this NameError exception:

$ dlipower set_outlet_name 1 "foo-bar"
Traceback (most recent call last):
  File "/home/.../dlipower", line 117, in <module>
    outlet_range = _block_to_list(','.join(args[1:]))
  File "/home/.../dlipower", line 49, in _block_to_list
    for value in outlet_range(int(val1), int(val2) + 1):
NameError: name 'outlet_range' is not defined

Setting to "foobar" works. I suspect the name is being interpreted as some kind of range but it's not clear how to escape the - character to avoid this behaviour.

DavidAntliff avatar Mar 13 '19 01:03 DavidAntliff