From 01cd79f702a633a660f4ed8e930960baad2f2547 Mon Sep 17 00:00:00 2001 From: idzuibenko Date: Wed, 29 Sep 2021 15:16:25 +0300 Subject: [PATCH] fixed ip routes, removed maps --- pym/install/distr.py | 2 +- pym/install/migrate_users.py | 3 ++- pym/install/variables/disk.py | 7 +++---- pym/install/variables/distr.py | 6 +++--- pym/install/variables/net.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pym/install/distr.py b/pym/install/distr.py index 1a0edc8..5223951 100644 --- a/pym/install/distr.py +++ b/pym/install/distr.py @@ -103,7 +103,7 @@ class cpProcessProgress(processProgress): self.value += 1 if self.maxfiles: percent = 100 * self.value // self.maxfiles - # percent = min(percent, 99) + percent = min(percent, 100) if percent > self.percent: self.percent = percent return percent diff --git a/pym/install/migrate_users.py b/pym/install/migrate_users.py index 126e2bd..d7a9011 100644 --- a/pym/install/migrate_users.py +++ b/pym/install/migrate_users.py @@ -452,7 +452,8 @@ class migrate(): os.chmod(homedir, perms) users = list(set([x[0] for x in addUsersList] + existsMigrateUsers) - {"root"}) try: - map(createHome, (x for x in self.dataUsers if x[0] in users)) + # map(createHome, (x for x in self.dataUsers if x[0] in users)) + [createHome(x) for x in self.dataUsers if x[0] in users] except Exception as e: raise MigrationError( _("Failed to create the user's home directory")) diff --git a/pym/install/variables/disk.py b/pym/install/variables/disk.py index 5d91200..ff2279c 100644 --- a/pym/install/variables/disk.py +++ b/pym/install/variables/disk.py @@ -917,13 +917,13 @@ class VariableOsLocationBriefData(LocationHelper, TableVariable): else: return -1, dev - devices = map(list, self.ZipVars( + devices = list(map(list, self.ZipVars( 'os_install_disk_dev', 'os_install_disk_mount', 'os_install_disk_format', 'os_install_disk_perform_format', 'os_install_disk_size', - humanreadable=hr)) + humanreadable=hr))) binds = [[dev, mp, "", "", ""] for dev, mp in self.ZipVars( @@ -1126,8 +1126,7 @@ class VariableOsLocationDest(LocationHelper, Variable): return path.normpath(val) return val - value = map(normpath, value) - return [x or "/" for x in value] + return [x or "/" for x in map(normpath, value)] def choice(self): if self.Get('cl_install_type') == 'flash': diff --git a/pym/install/variables/distr.py b/pym/install/variables/distr.py index 9fe465c..455c55b 100644 --- a/pym/install/variables/distr.py +++ b/pym/install/variables/distr.py @@ -226,11 +226,11 @@ class DistroRepository(Linux): def _findLatestFile(self, dirs, reMatch, keyfunc): """Find latest file in dirs, which match by reMatch, comparable part get by keyfunc""" - existsdirs = filter(path.exists, dirs) - listimgs = reduce(lambda x, y: x + map( + existsdirs = list(filter(path.exists, dirs)) + listimgs = reduce(lambda x, y: x + list(map( lambda x: reMatch.search( path.join(y, x)), - listDirectory(y)), + listDirectory(y))), existsdirs, []) listimgs = [x for x in listimgs if x] if listimgs: diff --git a/pym/install/variables/net.py b/pym/install/variables/net.py index ae70cde..a75359f 100644 --- a/pym/install/variables/net.py +++ b/pym/install/variables/net.py @@ -562,7 +562,7 @@ class VariableOsInstallNetRouteData(NetHelper, TableVariable): else: wrapper = lambda x: x - self.value = self.set(map(wrapper,value)) + self.value = self.set([wrapper(x) for x in value]) self.wasSet = True self.invalid = False # run check