Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1218122

Summary: redirecting non-ascii characters returns error
Product: Red Hat OpenStack Reporter: Eduard Barrera <ebarrera>
Component: python-openstackclientAssignee: Julie Pichon <jpichon>
Status: CLOSED WONTFIX QA Contact: Shai Revivo <srevivo>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0 (Juno)Keywords: Triaged, ZStream
Target Milestone: ---   
Target Release: 7.0 (Kilo)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-18 16:58:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eduard Barrera 2015-05-04 08:50:33 UTC
When openstack produces some non-ASCII output, and this output is redirected, the command considers the output ans non ASCII and returns the corresponding error, for example:
 
# openstack network list
+--------------------------------------+---------------+--------------------------------------+
| id | name | subnets |
+--------------------------------------+---------------+--------------------------------------+
| 3b55b2d5-17ac-4513-a3e8-cb4a37e37a22 | atlas_private | 70c05613-69be-4f2e-9bb7-0c663553fc3b |
| aabd57f5-466f-43b6-9552-6313969bf057 | public | b28760f1-c94e-4d55-9b60-aef11fba0e0c |
| c93ff469-d721-4096-bf7c-1e324c897de8 | public01 | 41dbe4f5-c043-4185-b453-9d3ff969bec8 |
| cc4ce9b1-cf60-4e3c-8320-f194ee66d034 | görans-nät | d046363c-31ec-4a29-923d-3bffda09ff00 |
+--------------------------------------+---------------+--------------------------------------+
 
# openstack network list| grep test
ERROR: openstack 'ascii' codec can't encode character u'\xf6' in position 618: ordinal not in range(128)
 
 
 Version-Release number of selected component (if applicable):
  OSP 6
 
How reproducible:
I was able to reporduce it in my env with neutron. I tried also with cinder but I dont get the error
 
Steps to Reproduce:
1. # openstack network list
2. # openstack network list | grep test

'ascii' codec can't encode character u'\xf6' in position 376: ordinal not in range(128)
 


Actual results:
Error when we pipe the output of neutron net-show to another command
 
 
Expected results:
The output should be passed correctly to other processes without having errors


 
Additional info:
python-openstackclient-1.0.1-1.el7ost.noarch

Comment 5 Ivan Chavero 2015-08-01 20:07:51 UTC
i'm hitting this same problem:


# /usr/bin/openstack project list --quiet --format csv --long
    "ID","Name","Description","Enabled"
    "54d208f5565c4727a1ad77a3922eac26","admin","admin tenant",True
    "c32f73afa3544bb8a5760e14ad0fc48c","Packstack","VM's for packstack testing",True
ERROR: openstack 'ascii' codec can't encode character u'\xe1' in position 1: ordinal not in range(128)

Comment 6 Ivan Chavero 2015-08-03 17:09:57 UTC
This bug has been fixed upstream: https://github.com/openstack/cliff/blob/master/cliff/formatters/commaseparated.py#L4

Comment 8 Felipe Alfaro Solana 2016-03-18 12:34:20 UTC
How many times are we going to hit non-ASCII bugs in OpenStack? ;-)
We reported similar errors back in Havana.

Comment 9 Felipe Alfaro Solana 2016-03-18 12:36:51 UTC
Also, the proposed fix in https://github.com/openstack/cliff/blob/master/cliff/formatters/commaseparated.py seems to be related to CSV. Doesn't OpenStack use JSON internally? How does a fix to CSV formatter solve the issue?

Comment 10 Felipe Alfaro Solana 2016-04-11 12:02:59 UTC
For the record, we are hitting the same bug here with Red Hat OpenStack 7.3. So clearly, something else is going on here.

Comment 16 Beth White 2018-07-18 16:58:24 UTC
Fix is in OSP10. Won't fix for OSP7 at this point due to EOL.