Skip to content

Commit

Permalink
fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
juanvallejo committed Mar 2, 2017
1 parent b587b22 commit d2e2d58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def run(self, tmp, task_vars):
is_containerized = get_var(task_vars, "openshift", "common", "is_containerized")
group_names = get_var(task_vars, "group_names", default=[])
ansible_mounts = get_var(task_vars, "ansible_mounts")
diskfree = self.to_gigabytes(self.get_disk_space(ansible_mounts))
diskfree = self.to_gibibytes(self.get_disk_space(ansible_mounts))

# if running containerized installation check
# that available space is not below 5% instead
Expand Down Expand Up @@ -67,7 +67,7 @@ def get_disk_space(ansible_mounts):
return None

@staticmethod
def to_gigabytes(total_bytes):
def to_gibibytes(total_bytes):
return total_bytes / 1073741824

@staticmethod
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# pylint: disable=missing-docstring
from openshift_checks import OpenShiftCheck, get_var

import json

class MemoryAvailability(OpenShiftCheck):
"""Check that recommended memory is available."""
Expand All @@ -24,11 +23,12 @@ def run(self, tmp, task_vars):

if self.to_gigabytes(memoryfree) < recommended_memory_gb:
kind = "master" if "masters" in group_names else "node"
msg = "Available memory for %s (%s) below recommended storage. Minimum required memory: %s GB" % (kind, memoryfree, recommended_memory_gb)
msg = "Available memory for %s (%s) below recommended storage. Minimum required memory: %s GB" \
% (kind, memoryfree, recommended_memory_gb)
return {"failed": True, "msg": msg}

return {"changed": False}

@staticmethod
def to_gigabytes(size_in_mb):
return float(size_in_mb) / 1024.0
return float(size_in_mb) / 1000.0

0 comments on commit d2e2d58

Please sign in to comment.