From 92377813448ff93e216ee688fb16f99958884b8c Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Wed, 10 May 2017 09:19:52 +0200 Subject: int -> float We don't need to convert to int and then to float. Read it as float from the start. --- roles/openshift_health_checker/openshift_checks/etcd_volume.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'roles') diff --git a/roles/openshift_health_checker/openshift_checks/etcd_volume.py b/roles/openshift_health_checker/openshift_checks/etcd_volume.py index c769af973..00e240231 100644 --- a/roles/openshift_health_checker/openshift_checks/etcd_volume.py +++ b/roles/openshift_health_checker/openshift_checks/etcd_volume.py @@ -17,8 +17,8 @@ class EtcdVolume(OpenShiftCheck): ansible_mounts = get_var(task_vars, "ansible_mounts") etcd_mount_path = self._get_etcd_mount_path(ansible_mounts) - etcd_disk_size_available = int(etcd_mount_path["size_available"]) - etcd_disk_size_total = int(etcd_mount_path["size_total"]) + etcd_disk_size_available = float(etcd_mount_path["size_available"]) + etcd_disk_size_total = float(etcd_mount_path["size_total"]) etcd_disk_size_used = etcd_disk_size_total - etcd_disk_size_available size_limit_percent = get_var( @@ -27,7 +27,7 @@ class EtcdVolume(OpenShiftCheck): default=self.etcd_default_size_limit_percent ) - if float(etcd_disk_size_used) / float(etcd_disk_size_total) > size_limit_percent: + if etcd_disk_size_used / etcd_disk_size_total > size_limit_percent: msg = ("Current etcd volume usage ({actual:.2f} GB) for the volume \"{volume}\" " "is greater than the storage limit ({limit:.2f} GB).") msg = msg.format( -- cgit v1.2.3