_get_zpool_info() may fail if locale is not english

Bug #1757371 reported by Adrien Cunin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nova-lxd
Fix Committed
Low
Unassigned

Bug Description

In nova/virt/lxd/driver.py, _get_zpool_info() and more specifically _get_zpool_attribute() parses the output of "zpool list -H". If locale is fr (for example) instead of english, size may be reported as "1,04T" instead of the expected "1.04T".

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

We use oslo strutils to parse the number, which also isn't locale sensitive. As zfs uses snprintf() for the number printing, and that IS locale sensitive, then yes, it would probably fail. Work around is to not install on locale other than English.

Changed in nova-lxd:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

Thinking some more on this (and related to https://bugs.launchpad.net/nova-lxd/+bug/1756900) we can probably use the '-p' option in the zpool list to get a parseable output without having to use strutils.

Changed in nova-lxd:
assignee: nobody → Alex Kavanagh (ajkavanagh)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova-lxd (master)

Reviewed: https://review.openstack.org/571226
Committed: https://git.openstack.org/cgit/openstack/nova-lxd/commit/?id=97cb7ea742d4dbcc83079da33ebb4d7e66d0ee9c
Submitter: Zuul
Branch: master

commit 97cb7ea742d4dbcc83079da33ebb4d7e66d0ee9c
Author: Alex Kavanagh <email address hidden>
Date: Wed May 30 16:19:00 2018 +0100

    Enable ZFS to work with datasets and all locales

    This fixes two bugs (independently) to get nova-lxd to work with
    datasets (pool/set) as well as pools (just 'pool'). It also, switches
    the attributes to use the '-p' option with 'zfs list' and 'zpool list'
    which returns the values in bytes rather than human readable format,
    which is more useful in nova-lxd.

    Change-Id: I2eb1b3ba7bd482e680933808414a3992a9a1feba
    Closes-Bug: #1756900
    Closes-Bug: #1757371

Changed in nova-lxd:
status: In Progress → Fix Released
Changed in nova-lxd:
status: Fix Released → Fix Committed
Changed in nova-lxd:
assignee: Alex Kavanagh (ajkavanagh) → nobody
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.