manila-share fails with lvm when using a different localization

Bug #1589928 reported by Alberto Molina Coballes
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Opinion
Medium
Jan Provaznik

Bug Description

manila-share fails using es_ES.UTF-8 localization, showing these logs:

2016-06-07 14:03:55.509 29878 DEBUG oslo_concurrency.processutils [req-df7a9650-8c6a-4159-b2bf-1a9d1112366d - - - - -] CMD "sudo manila-rootwrap /etc/manila/rootwrap.conf vgs lvm-shares --rows --units
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service [req-df7a9650-8c6a-4159-b2bf-1a9d1112366d - - - - -] Error starting thread.
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service Traceback (most recent call last):
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/oslo_service/service.py", line 680, in run_service
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service service.start()
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/service.py", line 121, in start
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service self.manager.init_host()
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/manager.py", line 146, in wrapped
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service return f(self, *args, **kwargs)
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/manager.py", line 322, in init_host
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service self.publish_service_capabilities(ctxt)
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/manager.py", line 146, in wrapped
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service return f(self, *args, **kwargs)
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/utils.py", line 616, in wrapper
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service return func(self, *args, **kwargs)
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/manager.py", line 2267, in publish_service_capabilities
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service self._report_driver_status(context)
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/utils.py", line 616, in wrapper
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service return func(self, *args, **kwargs)
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/manager.py", line 2231, in _report_driver_status
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service share_stats = self.driver.get_share_stats(refresh=True)
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/driver.py", line 546, in get_share_stats
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service self._update_share_stats()
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/drivers/lvm.py", line 190, in _update_share_stats
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service 'pools': self.get_share_server_pools()
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/drivers/lvm.py", line 199, in get_share_server_pools
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service total_size = re.findall("VSize\s[0-9.]+g", out)[0][6:-1]
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service IndexError: list index out of range
2016-06-07 14:03:55.511 29878 ERROR oslo_service.service

The issue is related to the output of the command "vgs lvm-shares --rows --units g", because in spanish the decimal mark is a comma instead of a point:

  VG lvm-shares
  #PV 1
  #LV 0
  #SN 0
  Attr wz--n-
  VSize 100,00g
  VFree 100,00g

get_share_server_pools() in lvm.py fails when a comma is present in the output.

Changed in manila:
importance: Undecided → Medium
milestone: none → newton-2
Revision history for this message
Luis Ugalde (forondarena) wrote :

Hi all,

For those of you facing this issue, I'm attaching the patch I use in my servers.

It might not the most elegant solution for upstream, but it should be good enough until someone writes a proper fix.

Regards,

Changed in manila:
assignee: nobody → Jan Provaznik (jan-provaznik)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

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

Changed in manila:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on manila (master)

Change abandoned by Jan Provaznik (<email address hidden>) on branch: master
Review: https://review.openstack.org/397778
Reason: The proper fix in this case is making sure that manila-share service runs with proper locales instead of trying to fix commands in drivers.

Revision history for this message
Jan Provaznik (jan-provaznik) wrote :

After discussing this with Valeriy on IRC the best solution would be setting locales on service level instead of setting them in driver. I would suggest closing this as "won't fix".

Changed in manila:
status: In Progress → Opinion
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.