unicode characters are not being handled properly

Bug #1508419 reported by Kyrylo Romanenko
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python-ironicclient
In Progress
Medium
Vadim Hmyrov

Bug Description

Dictionaries are displayed as Python literals in ironic node properties. Instead of being properly printed to the standard output stream.

It causes issues when displaying a non-ASCII characters in the properties names/values.
Look for example in paste: http://paste.openstack.org/show/476980/
Usage of Unicode characters can affect execution of next CLI commands.

Also it is harder to read large metadata, when it all printed in quotes and with "u" prefixes:
http://paste.openstack.org/show/476824/

VERSION:
  feature_groups:
    - mirantis
  production: "docker"
  release: "8.0"
  openstack_version: "2015.1.0-8.0"
  api: "1.0"
  build_number: "236"
  build_id: "2015-10-15_17-34-41"
  fuel-nailgun_sha: "ece438cbd9919c19469c14f707bd0a38c036fae7"
  python-fuelclient_sha: "655db5e96282bbafc4dae54462a01823b6b464cb"
  fuel-agent_sha: "5d2d5e2e9ad4f8bb01e450240d85447608d84b92"
  fuel-nailgun-agent_sha: "08e0a11cf1f29b705e4b910d9b9db5e9b708b6e3"
  astute_sha: "a090546d43c770ac27ca81c6f8c78ff0ba4a93e0"
  fuel-library_sha: "bf572ec8ea272bd02fcb86c2631b6acc8d10be3f"
  fuel-ostf_sha: "92afc66afc9d21341e8c220d1f80aa7945e6b2d0"
  fuel-createmirror_sha: "fe81731b76071dc0a4ffdf039080732243f5a871"
  fuelmain_sha: "9896d379981ea539ef834ce17f8f0f3a5e4a9e15"

python-ironicclient version: 0.5.1

Changed in mos:
status: New → Confirmed
importance: Medium → Low
Revision history for this message
Aliaksandr Buhayeu (abuhayeu) wrote :

Hi Kyrylo!

I believe we could get rid of 'u' Python literals, but general fix for Unicode characters representation in the properties which are objects is not trivial.

This issue should affect all other Openstack CLI clients as well, at least those that are running on Py2. Because on 'C' level printing of objects using `_repr_` method and it works differently on Py2 and Py3.

The roots of this problem described in the pep-3138 (https://www.python.org/dev/peps/pep-3138/) and fixed by patch for Py3 (http://bugs.python.org/issue2630).

Hope somebody could correct me if I have made wrong investigation.

What we might do:
1. display such properties as lines of rows in format "key: value" or manually prepare the output string that will looks like a dict
2. try to reuse patched _repr_ in Py2
3. add dependency on some module that already fixing this problem

First one looks safer for me..

Revision history for this message
Kyrylo Romanenko (kromanenko) wrote :

Hi Aliaksandr! You are right, other Openstack CLI clients are also affected by similiar issues with Unicode.
Can we fix visual representation of python literals at least? I`d prefer first way too.

Revision history for this message
Aliaksandr Buhayeu (abuhayeu) wrote :

Hi Kyrylo!

I will try to tackle this problem in a nearest time.

Revision history for this message
Aliaksandr Buhayeu (abuhayeu) wrote :

Hi MOS Ironic team!

I have tried to fix this issue and run into one of the OS Jenkins checks fail, specially the `gate-tempest-dsvm-python-ironicclient-src` one.

So I would like to ask for assistance in it investigation because currently not sure was it affected by my changes or not.

It fails with an error placed here http://logs.openstack.org/86/249186/1/check/gate-tempest-dsvm-python-ironicclient-src/2f2d879/console.html#_2015-11-24_13_36_39_876 and appropriate place in `devstacklog.txt` I believe is here http://logs.openstack.org/86/249186/1/check/gate-tempest-dsvm-python-ironicclient-src/2f2d879/logs/devstacklog.txt.gz#_2015-11-24_13_36_38_017 .

The review itself is here https://review.openstack.org/#/c/249186/

Maybe somebody could give at least a small point for further investigation steps for problem localization.

Any help appreciated!

affects: mos → ironic
Changed in ironic:
milestone: 8.0 → none
Revision history for this message
Kyrylo Romanenko (kromanenko) wrote :

Aliaksandr, I filed an issue to find a reason of that failures.
https://bugs.launchpad.net/ironic/+bug/1520163

Dmitry Tantsur (divius)
affects: ironic → python-ironicclient
tags: removed: ironic
Revision history for this message
Ruby Loo (rloo) wrote :

Hi MOS team, are you still looking into this?

Changed in python-ironicclient:
importance: Low → Medium
summary: - Dictionaries are displayed as Python literals in ironic node properties
+ unicode characters are not being handled properly
Vadim Hmyrov (vhmyrov)
Changed in python-ironicclient:
assignee: MOS Ironic (mos-ironic) → Vadim Hmyrov (vhmyrov)
Changed in python-ironicclient:
status: Confirmed → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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