]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
LVM: remove redundant casts to float
authorJon Bernard <jobernar@redhat.com>
Mon, 3 Feb 2014 17:44:33 +0000 (12:44 -0500)
committerJon Bernard <jobernar@redhat.com>
Mon, 3 Feb 2014 18:06:21 +0000 (13:06 -0500)
The vg_free_space field is always assigned a float, so additional casts
are not necessary.

Change-Id: Ic2af78ba7dbd7388cc071fc2f0ea876a1558d0e9

cinder/brick/local_dev/lvm.py

index 781234f84bb07f51b7ca91a9450604fed16ab0c5..68b569d78a25b134c4703c3d8bf85c706a63b5dc 100644 (file)
@@ -401,7 +401,7 @@ class LVM(executor.Executor):
         self.update_volume_group_info()
 
         # leave 5% free for metadata
-        return "%sg" % (float(self.vg_free_space) * 0.95)
+        return "%sg" % (self.vg_free_space * 0.95)
 
     def create_thin_pool(self, name=None, size_str=None):
         """Creates a thin provisioning pool for this VG.
@@ -633,5 +633,4 @@ class LVM(executor.Executor):
         return free_capacity
 
     def vg_mirror_size(self, mirror_count):
-        return (float(self.vg_free_space) /
-                (mirror_count + 1))
+        return (self.vg_free_space / (mirror_count + 1))