diff --git a/pym/client/client.py b/pym/client/client.py index 36809e2..b301308 100644 --- a/pym/client/client.py +++ b/pym/client/client.py @@ -30,7 +30,7 @@ from calculate.lib.cl_ini_parser import iniParser from calculate.lib.cl_print import color_print from calculate.lib.utils.ip import Pinger, IPError from calculate.lib.utils.files import (getModeFile, removeDir, - pathJoin, tarLinks, + pathJoin, tarLinks, readFile, listDirectory, process, find, STDOUT, checkUtils) from calculate.lib.utils.samba import Samba, SambaError @@ -890,7 +890,7 @@ class Client(commandServer, encrypt, Desktop): """ # read file list from config try: - filesProfileTxt = open(pathListFile).read() + filesProfileTxt = readFile(pathListFile) except IOError: return False listFilesProfile = filter(lambda x: x.strip(), @@ -928,8 +928,8 @@ class Client(commandServer, encrypt, Desktop): try: if os.path.exists(cmdLineFile) and \ os.path.exists(environFile): - return (open(cmdLineFile, 'r').read().strip(), - open(environFile, 'r').read().strip()) + return (readFile(cmdLineFile).strip(), + readFile(environFile).strip()) except (OSError, IOError): pass return "", "" diff --git a/pym/client/client_cache.py b/pym/client/client_cache.py index 4d22270..2612630 100644 --- a/pym/client/client_cache.py +++ b/pym/client/client_cache.py @@ -284,7 +284,7 @@ class _shareCache(_shareData): return False if not os.path.exists(self.fileName): try: - open(self.fileName, "w") + open(self.fileName, "w").close() except IOError: self.printERROR(_("Failed to create file %s") % self.fileName) return False