Browse Source

Исправлено создание отметки необходимости удаления старого ядра

tags/3.3.2_alpha2
Mike Khiretskiy 6 years ago
parent
commit
6584c7ef30
1 changed files with 10 additions and 8 deletions
  1. +10
    -8
      pym/update/update_info.py

+ 10
- 8
pym/update/update_info.py View File

@@ -21,7 +21,7 @@ from calculate.core.datavars import DataVarsCore
from calculate.core.server.gen_pid import search_worked_process
from calculate.lib.cl_template import SystemIni
from calculate.lib.utils.content import getCfgFiles
from calculate.lib.utils.files import getRunCommands, readFile
from calculate.lib.utils.files import getRunCommands, readFile, writeFile
import time


@@ -92,10 +92,12 @@ class UpdateInfo(object):
@outdated_kernel.setter
def outdated_kernel(self, value):
flag_path = self.dv.Get('update.cl_update_outdated_kernel_path')

if value:
with open(flag_path, 'w') as f:
f.write(self.dv.Get('update.cl_update_kernel_version'))
else:
if path.exists(flag_path):
os.unlink(flag_path)
try:
if value:
with writeFile(flag_path) as f:
f.write(self.dv.Get('update.cl_update_kernel_version'))
else:
if path.exists(flag_path):
os.unlink(flag_path)
except IOError:
pass

Loading…
Cancel
Save