summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorRodolfo Carvalho <rhcarvalho@gmail.com>2017-05-10 09:19:52 +0200
committerGitHub <noreply@github.com>2017-05-10 09:19:52 +0200
commit92377813448ff93e216ee688fb16f99958884b8c (patch)
treece201c56aaa6236e4af355fb4a39cc6190d57af1 /roles
parent8f52b334d618a489c0b2388303f5fa5132a59e2d (diff)
downloadopenshift-92377813448ff93e216ee688fb16f99958884b8c.tar.gz
openshift-92377813448ff93e216ee688fb16f99958884b8c.tar.bz2
openshift-92377813448ff93e216ee688fb16f99958884b8c.tar.xz
openshift-92377813448ff93e216ee688fb16f99958884b8c.zip
int -> float
We don't need to convert to int and then to float. Read it as float from the start.
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_health_checker/openshift_checks/etcd_volume.py6
1 files changed, 3 insertions, 3 deletions
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(