← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1638273] Re: find_child_pids crashes under non-english locals

 

Reviewed:  https://review.openstack.org/392137
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=3c1bf8697b9be4a406e978af8a3329389f992514
Submitter: Jenkins
Branch:    master

commit 3c1bf8697b9be4a406e978af8a3329389f992514
Author: John Schwarz <jschwarz@xxxxxxxxxx>
Date:   Tue Nov 1 14:28:32 2016 +0200

    Don't depend on translated strings for error check
    
    Currently, execute() may raise an exception that contains a *translated*
    string that starts with 'Exit code: %(returncode)d...' if the returncode
    of a process was not 0. find_child_pids() will then check if the
    raised exception contains 'Exit code: 1' (to check if the returncode is
    1), but in non-English locales this will fail as the 2 strings are not
    encoded the same.
    
    This patch adds a new ProcessExecutionError (which inherits from
    RuntimeError, so as to not change all the code that currently depends on
    execute() returning RuntimeError) which now accepts a returncode. This
    can be changed explicitly without depending on the error message.
    
    Later patches can move ProcessExecutionError to neutron-lib, if this is
    needed - this patch intends to write the smallest piece of code that can
    be backported.
    
    Closes-Bug: #1638273
    Change-Id: I85d3bec13e852918eb13e73c1367c70e1f4d34b1


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1638273

Title:
  find_child_pids crashes under non-english locals

Status in neutron:
  Fix Released

Bug description:
  Traceback available at [1].

  The function execute() returns _("Exit code: %(returncode)d; ...")
  [2]. Under non-English locales (we checked for Japanese, but surely
  this will also occur in others, the check 'Exit code: 1' in str(e)
  [3] will fail since 'Exit code: 1' is not encoded the same.

  This ultimately prevents stuff like booting a new VM.

  [1]: http://pastebin.com/x66aqctN
  [2]: https://github.com/openstack/neutron/blob/15d65607a47810f7d155d43902d358cb9f953a7a/neutron/agent/linux/utils.py#L127
  [3]: https://github.com/openstack/neutron/blob/15d65607a47810f7d155d43902d358cb9f953a7a/neutron/agent/linux/utils.py#L176

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1638273/+subscriptions


References