cinder-volume capacity data parsing fails with non english locale

Bug #1151684 reported by Christoph Kassen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Christoph Kassen

Bug Description

In the LVM driver the capacity is calculated from the output of the vgs command. On systems with non english locale, where the decimal seperator is not a dot cinder-volume is unable to parse that data, which results in an exception.

The exception message is:
INFO cinder.volume.manager [req-5b10cf00-817e-4ddf-826e-9daecd3bc4b8 None None] Updating volume status
ERROR cinder.service [req-5b10cf00-817e-4ddf-826e-9daecd3bc4b8 None None] Unhandled exception
TRACE cinder.service Traceback (most recent call last):
TRACE cinder.service File "/opt/stack/cinder/cinder/service.py", line 224, in _start_child
TRACE cinder.service self._child_process(wrap.server)
TRACE cinder.service File "/opt/stack/cinder/cinder/service.py", line 201, in _child_process
TRACE cinder.service launcher.run_server(server)
TRACE cinder.service File "/opt/stack/cinder/cinder/service.py", line 95, in run_server
TRACE cinder.service server.start()
TRACE cinder.service File "/opt/stack/cinder/cinder/service.py", line 342, in start
TRACE cinder.service self.manager.init_host()
TRACE cinder.service File "/opt/stack/cinder/cinder/volume/manager.py", line 160, in init_host
TRACE cinder.service self.publish_service_capabilities(ctxt)
TRACE cinder.service File "/opt/stack/cinder/cinder/volume/manager.py", line 653, in publish_service_capabilities
TRACE cinder.service self._report_driver_status(context)
TRACE cinder.service File "/opt/stack/cinder/cinder/volume/manager.py", line 645, in _report_driver_status
TRACE cinder.service volume_stats = self.driver.get_volume_stats(refresh=True)
TRACE cinder.service File "/opt/stack/cinder/cinder/volume/drivers/lvm.py", line 546, in get_volume_stats
TRACE cinder.service self._update_volume_status()
TRACE cinder.service File "/opt/stack/cinder/cinder/volume/drivers/lvm.py", line 581, in _update_volume_status
TRACE cinder.service data['total_capacity_gb'] = float(volume[1])
TRACE cinder.service ValueError: invalid literal for float(): 0,52

A fix is available and submitted for review at: https://review.openstack.org/#/c/23720/

Changed in cinder:
assignee: nobody → Christoph Kassen (c-kassen)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/23720
Committed: http://github.com/openstack/cinder/commit/6c8d860507a66424cf47b46380478b3cc565359e
Submitter: Jenkins
Branch: master

commit 6c8d860507a66424cf47b46380478b3cc565359e
Author: Christoph Kassen <email address hidden>
Date: Wed Mar 6 19:37:42 2013 +0100

    Fix volume capacity reporting

    cinder-volume crashes when the decimal point is not represented by a dot
    but by a comma instead. This crash happens for example with the de_DE
    locale.

    This change replaces any comma appearing in the vgs command output with
    a dot.

    Test case added.

    Fixes: bug #1151684
    Change-Id: I831055fb7fd206a8560688ec4c25d766e92ee0f0

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → grizzly-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: grizzly-rc1 → 2013.1
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.