|
|
|
@ -717,7 +717,8 @@ class VariableOsLocationSource(LocationHelper,DeviceHelper,Variable):
|
|
|
|
|
dupDevices = list(set(filter(lambda x:disks.count(x)>1,
|
|
|
|
|
disks)))
|
|
|
|
|
if dupDevices:
|
|
|
|
|
raise VariableError(_("Device '%s' is used twice")%dupDevices[0])
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Device '%s' is used more than once")%dupDevices[0])
|
|
|
|
|
|
|
|
|
|
class VariableOsLocationDest(LocationHelper,Variable):
|
|
|
|
|
"""
|
|
|
|
@ -801,10 +802,11 @@ class VariableOsLocationDest(LocationHelper,Variable):
|
|
|
|
|
# detect duplicate mps
|
|
|
|
|
##########################
|
|
|
|
|
dupMP = list(set(filter(lambda x:value.count(x)>1,
|
|
|
|
|
filter(lambda x:x,
|
|
|
|
|
filter(lambda x:x and x != "swap",
|
|
|
|
|
value))))
|
|
|
|
|
if dupMP:
|
|
|
|
|
raise VariableError(_("Mount point '%s' is used twice")%dupMP[0])
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Mount point '%s' is used more than once")%dupMP[0])
|
|
|
|
|
#########################
|
|
|
|
|
# detect wrong bind
|
|
|
|
|
#########################
|
|
|
|
@ -953,6 +955,9 @@ class VariableOsLocationFormat(LocationHelper,Variable):
|
|
|
|
|
devMpFs = zip(self.Get('os_location_source'),
|
|
|
|
|
self.Get('os_location_dest'),value)
|
|
|
|
|
for dev,mp,fs in devMpFs:
|
|
|
|
|
if dev.startswith('/') and not dev.startswith('/dev/') and fs:
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Bind mount points does not use filesystem"))
|
|
|
|
|
# check compatible fs for mount point only root dirs
|
|
|
|
|
if dev.startswith('/dev/') and mp and (mp.count('/') == 1 or
|
|
|
|
|
mp == '/var/calculate'):
|
|
|
|
@ -1067,7 +1072,10 @@ class VariableOsLocationPerformFormat(LocationHelper,Variable):
|
|
|
|
|
self.Get('os_location_format'),
|
|
|
|
|
value)
|
|
|
|
|
return map(self.defaultPerformFormat(),
|
|
|
|
|
info)
|
|
|
|
|
map(lambda x:[x[DEV],x[MP],x[FS],""] \
|
|
|
|
|
if x[FORMAT] == "off" and not x[DEV].startswith("/dev/")
|
|
|
|
|
else x,
|
|
|
|
|
info))
|
|
|
|
|
|
|
|
|
|
class VariableOsLocationSize(LocationHelper,SourceReadonlyVariable):
|
|
|
|
|
"""
|
|
|
|
|