diff --git a/uos-sysmig/sysmig_agent/short_task.py b/uos-sysmig/sysmig_agent/short_task.py index 8d1e0895d0610c394a88d4a129a4d04da3ff6b30..dff5ae67fd568011301b9c0881e35aaabc348f97 100644 --- a/uos-sysmig/sysmig_agent/short_task.py +++ b/uos-sysmig/sysmig_agent/short_task.py @@ -148,8 +148,6 @@ def init_remove_oldrepo(): content = fsrc.read() with open(path_file + '.disabled', 'w') as fdst: fdst.write(backup_comment + content) - fdst.close() - fsrc.close() os.remove(path_file) @@ -197,7 +195,6 @@ def initRepoFile(baseurl): repofile = os.path.join(reposdir, 'switch-to-uos.repo') with open(repofile, 'w') as f_repo: f_repo.write(repostr_uos) - f_repo.close() # 检测repo文件创建缓存 @@ -317,7 +314,6 @@ def initRepoFile_add(filename, baseurl): '\n') + '''\nenabled = 0\ngpgcheck = 0\nskip_if_unavailable = 1\n\n''' with open(os.path.join(AGENT_DIR, filename+'.repo'), 'a') as frepo: frepo.write(repostr_uos) - frepo.close() class RepoFileAdd(object):