Исправлено получение данных из 'битого' образа

master3.3
Mike khiretskiy 11 years ago
parent fa95dd5097
commit a8bcbaff4e

@ -458,7 +458,7 @@ class Distributive(object):
PartitionDistributive:"partdir"}
extname = mapExtName.get(distr.__class__,"")
image = distr.convertToDirectory()
except Exception,e:
except Exception as e:
if distr:
distr.close()
return {}.copy()

@ -26,6 +26,7 @@ from calculate.lib.utils.common import (getVideoFromXorgLog,
getAvailableVideo, getValueFromCmdLine,
getCompositeFromXorgconf, getVideoFromModules,
getVideoFromVendor,getInstalledVideo)
from calculate.install.distr import DistributiveError
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_install3',sys.modules[__name__])
@ -109,10 +110,13 @@ class VariableOsInstallX11VideoAvailable(VideoVariable):
image = self.Get('cl_image')
if image:
with image as distr:
distrPath = image.getDirectory()
if isPkgInstalled('xorg-server',prefix=distrPath):
return sorted(filter(self.supported.__contains__,
getAvailableVideo(prefix=distrPath)))+['other']
try:
distrPath = image.getDirectory()
if isPkgInstalled('xorg-server',prefix=distrPath):
return sorted(filter(self.supported.__contains__,
getAvailableVideo(prefix=distrPath)))+['other']
except DistributiveError as e:
pass
return []
class VariableOsX11KmsVideoDrv(ReadonlyVariable):

@ -30,6 +30,7 @@ from calculate.lib.utils.common import (getKernelUid,getTupleVersion,
getValueFromCmdLine)
from calculate.lib.utils.device import getUdevDeviceInfo
from itertools import *
from calculate.install.distr import DistributiveError
class VariableOsInstallKernelScheduler(Variable):
"""
@ -85,11 +86,14 @@ class VariableOsInstallKernelBfqSet(ReadonlyVariable):
image = self.Get('cl_image')
if image:
with image as distr:
distrPath = image.getDirectory()
kernelConfig = path.join(distrPath,"usr/src/linux/.config")
if filter(lambda x:"CONFIG_IOSCHED_BFQ=y" in x,
readLinesFile(kernelConfig)):
return "on"
try:
distrPath = image.getDirectory()
kernelConfig = path.join(distrPath,"usr/src/linux/.config")
if filter(lambda x:"CONFIG_IOSCHED_BFQ=y" in x,
readLinesFile(kernelConfig)):
return "on"
except DistributiveError as e:
return "off"
return "off"
class VariableOsInstallKernelAttr(Variable):

@ -35,6 +35,7 @@ from calculate.lib.utils.portage import isPkgInstalled
from operator import itemgetter
from itertools import *
import hashlib
from calculate.install.distr import DistributiveError
class NetHelper:
"""
@ -649,11 +650,14 @@ class VariableOsInstallNetConfAvailable(NetHelper,Variable):
image = self.Get('cl_image')
if image:
with image as distr:
distrPath = image.getDirectory()
return map(itemgetter(0,2),
filter(lambda x:not x[1] or isPkgInstalled(x[1],
prefix=distrPath),
mapNetConf))
try:
distrPath = image.getDirectory()
return map(itemgetter(0,2),
filter(lambda x:not x[1] or isPkgInstalled(x[1],
prefix=distrPath),
mapNetConf))
except DistributiveError as e:
pass
return sorted(map(itemgetter(0,2),mapNetConf[-1:]),key=itemgetter(1))
class VariableOsInstallNetConf(NetHelper,Variable):

Loading…
Cancel
Save