Description of problem ====================== With various classes/instances, LMIInstance.doc() always fails if called outside `lmishell`. The failure propagates as ValueError from textwrap; trace leads to `LMITextFormatter.format` (line 101 of LMIFormatter.py. Version-Release number of selected component (if applicable): ============================================ openlmi-tools-0.10.1 (built from git repo) How reproducible ================ Always (outside lmiwbem) Steps to Reproduce: 1. c = connect(..) 2. i = c.root.cimv2.CIM_ManagedElement.first_instance() 3. i.doc() Actual results ============== Traceback as described above Expected results ================ Displaying of documentation Additional info =============== * Observed with LMI and non-LMI instances. * With lmishell, this displays lister with a MOF-like documentation * Full traceback: Traceback (most recent call last): File "./docfail.lmishell", line 25, in <module> i.doc() File "/usr/lib/python2.7/site-packages/openlmi_tools-0.10.1-py2.7.egg/lmi/shell/LMIDecorators.py", line 228, in wrapper return fn(self_wr, *args, **kwargs) File "/usr/lib/python2.7/site-packages/openlmi_tools-0.10.1-py2.7.egg/lmi/shell/LMIDecorators.py", line 99, in wrapper return fn(self_wr, *args, **kwargs) File "/usr/lib/python2.7/site-packages/openlmi_tools-0.10.1-py2.7.egg/lmi/shell/LMIInstance.py", line 257, in doc formatter.fancy_format(self._conn.client.interactive) File "/usr/lib/python2.7/site-packages/openlmi_tools-0.10.1-py2.7.egg/lmi/shell/LMIFormatter.py", line 148, in fancy_format self.format(0, 0, self._width) File "/usr/lib/python2.7/site-packages/openlmi_tools-0.10.1-py2.7.egg/lmi/shell/LMIFormatter.py", line 308, in format formatter.format(indent, width, f) File "/usr/lib/python2.7/site-packages/openlmi_tools-0.10.1-py2.7.egg/lmi/shell/LMIFormatter.py", line 101, in format for l in wrapper.wrap(self._text): File "/usr/lib64/python2.7/textwrap.py", line 329, in wrap return self._wrap_chunks(chunks) File "/usr/lib64/python2.7/textwrap.py", line 258, in _wrap_chunks raise ValueError("invalid width %r (must be > 0)" % self.width) ValueError: invalid width 0 (must be > 0)
Created attachment 933910 [details] a simple reproducer
Fixed: - git (2354ffe) - openlmi-tools-0.10.1-2.fc21 - openlmi-tools-0.10.1-2.fc22