Add print partitions.

lvmraid
Mike Hiretsky 13 years ago
parent 21bd3595b1
commit 71ae46b885

@ -818,6 +818,12 @@ class cl_install(color_print, SignalInterrupt):
return instnextres
return curnextres
def printAllPartitonsTable(self):
"""Print install report"""
title, headerList, dataList = self.generateTableAllPartitionData()
tableObj = tableReport("", headerList, dataList)
tableObj.printReport(False)
def printLocationTables(self):
"""Print install report"""
title, headerList, dataList = self.generateTableMountData()
@ -1759,6 +1765,29 @@ class cl_install(color_print, SignalInterrupt):
if grubProcess.failed():
raise DistributiveError(_("Cann't install bootloader"))
def generateTableAllPartitionData(self):
"""Generate table for all partitions"""
def convertTypeToScheme(diskType):
res = ""
typeDict = {'loop':_("Loop"),
'raid':_("RAID"),
'lvm':_("LVM"),
'partition':_("Partition"),
'disk':_("Disk")}
for i in diskType.split('-'):
res = "%s on %s"%(typeDict.get(i,_('None')),res) if res else \
typeDict.get(i,_('None'))
return res
title = _("Available partitions")
headerList = [_("Size"),_("Device"),_("Label"),_("Directory"),
_("File system"), _("Scheme")]
return title, headerList, zip(self.clVars.Get('os_disk_size'),
self.clVars.Get('os_disk_dev'),
self.clVars.Get('os_disk_name'),
self.clVars.Get('os_disk_mount'),
self.clVars.Get('os_disk_format'),
map(convertTypeToScheme,self.clVars.Get('os_disk_type')))
def generateTableMountData(self):
"""Get data from print table"""
title = _("Location")

@ -147,7 +147,10 @@ CMD_OPTIONS = [{'shortOption':"d",
{'shortOption':"P",
'help':_("use passwords for the users accounts \
(from standard input)")
}]
},
{'longOption':"show-partitions",
'help':_("display all partitions")}
]
class OptException(Exception):
pass
@ -471,6 +474,9 @@ class install_cmd(share_cmd):
else:
return False
def showPartitions(self):
self.logicObj.printAllPartitonsTable()
def configureSystem(self):
"""Run configure system"""
if self.logicObj.configureSystem():

@ -59,6 +59,9 @@ if __name__ == "__main__":
if options.v or options.filter or options.xml:
install.printVars(options)
sys.exit(0)
if options.show_partitions:
install.showPartitions()
sys.exit(0)
# check root
if not install.isRoot():
sys.exit(1)

Loading…
Cancel
Save