Move wo_ram & wo_swap variables in addswap.py
This commit is contained in:
@@ -16,8 +16,11 @@ class WOSwap():
|
|||||||
|
|
||||||
def add(self):
|
def add(self):
|
||||||
"""Swap addition with WordOps"""
|
"""Swap addition with WordOps"""
|
||||||
if WOVariables.wo_ram < 512:
|
# Get System RAM and SWAP details
|
||||||
if WOVariables.wo_swap < 1000:
|
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...")
|
Log.info(self, "Adding SWAP file, please wait...")
|
||||||
|
|
||||||
# Install dphys-swapfile
|
# Install dphys-swapfile
|
||||||
|
|||||||
@@ -74,10 +74,6 @@ class WOVariables():
|
|||||||
os.system(
|
os.system(
|
||||||
"/usr/bin/git config --global user.email {0}".format(wo_email))
|
"/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
|
# MySQL hostname
|
||||||
wo_mysql_host = ""
|
wo_mysql_host = ""
|
||||||
config = configparser.RawConfigParser()
|
config = configparser.RawConfigParser()
|
||||||
|
|||||||
Reference in New Issue
Block a user