From e71be9d684bd893e70b588e3c2d372c058d7d4fc Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 19 Jun 2019 17:20:24 +0200 Subject: [PATCH] Move wo_ram & wo_swap variables in addswap.py --- wo/core/addswap.py | 7 +++++-- wo/core/variables.py | 4 ---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/wo/core/addswap.py b/wo/core/addswap.py index 5feb1e5..92011b4 100644 --- a/wo/core/addswap.py +++ b/wo/core/addswap.py @@ -16,8 +16,11 @@ class WOSwap(): def add(self): """Swap addition with WordOps""" - if WOVariables.wo_ram < 512: - if WOVariables.wo_swap < 1000: + # Get System RAM and SWAP details + wo_ram = psutil.virtual_memory().total / (1024 * 1024) + wo_swap = psutil.swap_memory().total / (1024 * 1024) + if wo_ram < 512: + if wo_swap < 1000: Log.info(self, "Adding SWAP file, please wait...") # Install dphys-swapfile diff --git a/wo/core/variables.py b/wo/core/variables.py index ea5e7b2..b89ec51 100644 --- a/wo/core/variables.py +++ b/wo/core/variables.py @@ -74,10 +74,6 @@ class WOVariables(): os.system( "/usr/bin/git config --global user.email {0}".format(wo_email)) - # Get System RAM and SWAP details - wo_ram = psutil.virtual_memory().total / (1024 * 1024) - wo_swap = psutil.swap_memory().total / (1024 * 1024) - # MySQL hostname wo_mysql_host = "" config = configparser.RawConfigParser()