Error casting value to float in lvm.py
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Medium
|
Haomai Wang |
Bug Description
When I launch the cinder-volume service i get this error:
2013-09-02 21:34:37.310 DEBUG cinder.
2013-09-02 21:34:37.407 ERROR cinder.service [req-3901dc67-
2013-09-02 21:34:37.407 TRACE cinder.service Traceback (most recent call last):
2013-09-02 21:34:37.407 TRACE cinder.service File "/opt/stack/
2013-09-02 21:34:37.407 TRACE cinder.service self._child_
2013-09-02 21:34:37.407 TRACE cinder.service File "/opt/stack/
2013-09-02 21:34:37.407 TRACE cinder.service launcher.
2013-09-02 21:34:37.407 TRACE cinder.service File "/opt/stack/
2013-09-02 21:34:37.407 TRACE cinder.service server.start()
2013-09-02 21:34:37.407 TRACE cinder.service File "/opt/stack/
2013-09-02 21:34:37.407 TRACE cinder.service self.manager.
2013-09-02 21:34:37.407 TRACE cinder.service File "/opt/stack/
2013-09-02 21:34:37.407 TRACE cinder.service self.publish_
2013-09-02 21:34:37.407 TRACE cinder.service File "/opt/stack/
2013-09-02 21:34:37.407 TRACE cinder.service self._report_
2013-09-02 21:34:37.407 TRACE cinder.service File "/opt/stack/
2013-09-02 21:34:37.407 TRACE cinder.service volume_stats = self.driver.
2013-09-02 21:34:37.407 TRACE cinder.service File "/opt/stack/
2013-09-02 21:34:37.407 TRACE cinder.service self._update_
2013-09-02 21:34:37.407 TRACE cinder.service File "/opt/stack/
2013-09-02 21:34:37.407 TRACE cinder.service data['free_
2013-09-02 21:34:37.407 TRACE cinder.service ValueError: invalid literal for float(): 10,01
2013-09-02 21:34:37.407 TRACE cinder.service
I fix it change the line 691 of the file cinder/
-> data['free_
to
-> data['free_
I think someone forgot to parse the float before doing the casting.
Changed in cinder: | |
assignee: | nobody → ugvddm (271025598-9) |
Changed in cinder: | |
assignee: | ugvddm (271025598-9) → nobody |
Changed in cinder: | |
milestone: | none → havana-3 |
milestone: | havana-3 → havana-rc1 |
Changed in cinder: | |
assignee: | nobody → Haomai Wang (haomai) |
Changed in cinder: | |
status: | Triaged → Fix Committed |
Changed in cinder: | |
status: | Fix Committed → Fix Released |
Changed in cinder: | |
milestone: | havana-rc1 → 2013.2 |
Sorry, actually it was:
from:
-> data['free_ capacity_ gb'] = float(self. vg.vg_free_ space)
to
-> data['free_ capacity_ gb'] = float(self. vg.vg_free_ space.replace( ",","." ))