get_binary_name should returns strings without spaces

Bug #1404250 reported by Cedric Brandily
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Cedric Brandily

Bug Description

get_binary_name() generates a string from sys.argv[0] which could contains spaces:
 * python -m unittest whatever implies sys.argv[0] = "python -m unittest" and get_binary_name == 'python -m unitte'

But iptables does not support spaces in chain name ... and get_binary_name() is used as prefix in chain name by iptables_manager
 * python -m unittest whatever implies incorrect iptables chain definition: iptables -N python -m unittest.

It typically brakes functional tests runned using python -m unittest $class.

Tags: l3-ipam-dhcp
Changed in neutron:
assignee: nobody → venkata anil (anil-venkata)
Changed in neutron:
assignee: venkata anil (anil-venkata) → Cedric Brandily (cbrandily)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/143108
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=0937dca14b1f60bdf3d4377ee305d41a1721f153
Submitter: Jenkins
Branch: master

commit 0937dca14b1f60bdf3d4377ee305d41a1721f153
Author: Cedric Brandily <email address hidden>
Date: Fri Dec 19 15:05:53 2014 +0100

    get_binary_name should returns strings without spaces

    Iptables does not support chain names with spaces. It implies
    get_binary_name should return strings without spaces (they are used as
    chain name prefix). But currently 'python -m unittest $module' implies
    spaces in get_binary_name() result, it disallows to use it when $module
    is a functional test module. This change replaces spaces with
    underscores in get_binary_name results.

    Change-Id: Ie7c8518b92be46a4eea4e9345713fdeba844126d
    Closes-Bug: #1404250

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-2 → 2015.1.0
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.