When working with python3 header banner is not rendered properly

Bug #1785606 reported by Yuval Adar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Yuval Adar
Vitrage Dashboard
Fix Released
Undecided
Yuval Adar

Bug Description

When running horizon under python 3, the header banner response returned is in bytes format, and python 3 interprets it different from python 2, thus breaking the banner completely

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/589121

Changed in horizon:
assignee: nobody → Yuval Adar (yadar)
status: New → In Progress
Changed in horizon:
assignee: Yuval Adar (yadar) → Eyal B (eyalb1)
Changed in horizon:
assignee: Eyal B (eyalb1) → Yuval Adar (yadar)
Revision history for this message
Akihiro Motoki (amotoki) wrote :

What is "header banner response" you mean?

I installed libapache2-mod-wsgi-py3 to run horizon with python3, but it seems everything works fine.
Could you elaborate more?

Revision history for this message
Yuval Adar (yadar) wrote :

When rendering the web page you have the header and the main body sections. In the header, you can display a custom banner. When you have Vitrage (RCA project) enabled, the header will display Vitrage banner.
This is rendered using request.render() from Django

When everything works with python2, request.render() returns byte encoded response, and python2.7 ignores is and treats is like plain text string. Python3 doesn't ignore it, and it breaks

This patch reformats the response for python3 and python2 and the banner will render properly

See posted screenshots for more details

Revision history for this message
Yuval Adar (yadar) wrote :

same one rendered on python 2.7

Yuval Adar (yadar)
Changed in vitrage-dashboard:
assignee: nobody → Yuval Adar (yadar)
Yuval Adar (yadar)
Changed in vitrage-dashboard:
status: New → In Progress
Akihiro Motoki (amotoki)
Changed in horizon:
milestone: none → rocky-rc1
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/589121
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=f7eefaa9937f2fc1e05caee65334cdd0d93159c9
Submitter: Zuul
Branch: master

commit f7eefaa9937f2fc1e05caee65334cdd0d93159c9
Author: Yuval Adar <email address hidden>
Date: Mon Aug 6 14:14:24 2018 +0300

    force plain text for header response

    Change-Id: I239a1ccc530ce652cc2165eef38b9f8193769102
    Closes-Bug: #1785606

Changed in horizon:
status: In Progress → Fix Released
Yuval Adar (yadar)
Changed in vitrage-dashboard:
status: In Progress → Fix Released
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.