Bug 1126763

Summary: [ovirt-engine-cli] in cli engine failed to redirect Unicode characters to file
Product: Red Hat Enterprise Virtualization Manager Reporter: Kobi Hakimi <khakimi>
Component: ovirt-engine-cliAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED ERRATA QA Contact: Shai Revivo <srevivo>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: ecohen, gklein, iheim, oramraz, rbalakri, Rhev-m-bugs, yeylon
Target Milestone: ---   
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: rhevm-cli-3.5.0.3-1.el6_5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-11 18:10:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1142923, 1156165    

Description Kobi Hakimi 2014-08-05 08:35:53 UTC
Description of problem:
[ovirt-engine-cli] in cli engine failed to redirect Unicode characters to file

Version-Release number of selected component (if applicable):
 Red Hat Enterprise Virtualization Manager Version: 3.4.0-0.21.el6ev 

How reproducible:
Always

Steps to Reproduce:
1. Create new VM with unicode name like : čeněk
2. Open the cli engine and run the command: 
   show vm --id "<new-vm-id>" > /tmp/test.log

Actual results:
failed with the following error:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/cli/context.py", line 191, in execute_string
    self._execute_command(command)
  File "/usr/lib/python2.6/site-packages/cli/context.py", line 411, in _execute_command
    command.run(self)
  File "/usr/lib/python2.6/site-packages/cli/command/command.py", line 101, in run
    self.execute()
  File "/usr/lib/python2.6/site-packages/ovirtcli/command/show.py", line 152, in execute
    self.context.formatter.format(self.context, obj)
  File "/usr/lib/python2.6/site-packages/ovirtcli/format/text.py", line 269, in format
    self._format_resource(result.superclass, show_empty=show_all)
  File "/usr/lib/python2.6/site-packages/ovirtcli/format/text.py", line 222, in _format_resource
    self.__write_context(format0, format1, width1, field, value, resource_context, reduced_mode_fields=reduced_mode_fields, mode=mode)
  File "/usr/lib/python2.6/site-packages/ovirtcli/format/text.py", line 137, in __write_context
    stdout.write(format1 % val)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u010d' in position 0: ordinal not in range(128)


Expected results:
Run with support to Unicode characters 

Additional info:
when run the command without redirect its run OK.
 show vm --id "<new-vm-id>"

Comment 1 Kobi Hakimi 2014-09-10 05:51:28 UTC
1. adding new cluster named čeněk
2. in cli api run the command:  list clusters --show-all > /tmp/test_kobi.log

Result: run without errors and redirect the output to the file - fixed

Comment 3 errata-xmlrpc 2015-02-11 18:10:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0185.html