Behavior for pyghmi.console.Console(iohandler) doesn't match doc

Bug #1719665 reported by Katrina
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyghmi
New
Undecided
Unassigned

Bug Description

According to [docstring](https://github.com/openstack/pyghmi/blob/master/pyghmi/ipmi/console.py#L36-L38) the `iohandler` arg in pyghmi.console.Console can be "Either a function to call with bytes, a filehandle to use for input and output, or a tuple of (input, output) handles". However, if a tuple is provided, as soon as there is something to output, it throws error:

```
  File "/path/to/repo/pyghmi/pyghmi/ipmi/console.py", line 301, in _print_data
    self.out_handler(data)
TypeError: 'tuple' object is not callable
```

Seems like pyghmi is now expecting a callable function and does not accept a tuple of handles:
https://github.com/openstack/pyghmi/blob/master/pyghmi/ipmi/console.py#L301

Looks like change in behavior was introduced here:
https://github.com/openstack/pyghmi/commit/e9000313f2cef935edd3eb9a9c57128995b5c0be

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.