diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index fe648ade..946cf343 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -1817,24 +1817,20 @@ class EEStackController(CementBaseController): if EEVariables.ee_ram < 512: Log.debug(self, "Setting maxmemory variable to {0} in redis.conf" .format(int(EEVariables.ee_ram*1024*1024*0.1))) - EEFileUtils.searchreplace(self, "/etc/redis/redis.conf", - "# maxmemory ", - "maxmemory {0}".format(int(EEVariables.ee_ram*1024*1024*0.1))) + EEShellExec.cmd_exec(self, "sed -i 's/# maxmemory /maxmemory {0}/' /etc/redis/redis.conf" + .format(int(EEVariables.ee_ram*1024*1024*0.1))) Log.debug(self, "Setting maxmemory-policy variable to volatile-lru in redis.conf") - EEFileUtils.searchreplace(self, "/etc/redis/redis.conf", - "# maxmemory-policy volatile-lru", - "maxmemory-policy volatile-lru") + EEShellExec.cmd_exec(self, "sed -i 's/# maxmemory-policy.*/maxmemory-policy volatile-lru/' " + "/etc/redis/redis.conf") EEService.restart_service(self, 'redis-server') else: Log.debug(self, "Setting maxmemory variable to {0} in redis.conf" .format(int(EEVariables.ee_ram*1024*1024*0.2))) - EEFileUtils.searchreplace(self, "/etc/redis/redis.conf", - "# maxmemory ", - "maxmemory {0}".format(int(EEVariables.ee_ram*1024*1024*0.2))) + EEShellExec.cmd_exec(self, "sed -i 's/# maxmemory /maxmemory {0}/' /etc/redis/redis.conf" + .format(int(EEVariables.ee_ram*1024*1024*0.2))) Log.debug(self, "Setting maxmemory-policy variable to volatile-lru in redis.conf") - EEFileUtils.searchreplace(self, "/etc/redis/redis.conf", - "# maxmemory-policy volatile-lru", - "maxmemory-policy volatile-lru") + EEShellExec.cmd_exec(self, "sed -i 's/# maxmemory-policy.*/maxmemory-policy volatile-lru/' " + "/etc/redis/redis.conf") EEService.restart_service(self, 'redis-server') if disp_msg: if len(self.msg):