def process_config_ptable(self):
log.log(log.LOG_INFO, "Processing Partition Tables")
for ptable in self.get_config_section('partition-table'):
try:
self.validator.ptable(ptable)
except MultipleInvalid as e:
log.log(log.LOG_WARN, "Cannot create Partition Table '{0}': YAML validation Error: {1}".format(ptable['name'], e))
continue
try:
ptable_id = self.fm.ptables.show(ptable['name'])['id']
log.log(log.LOG_DEBUG, "Partition Table '{0}' (id={1}) already present.".format(ptable['name'], ptable_id))
except:
log.log(log.LOG_INFO, "Create Partition Table '{0}'".format(ptable['name']))
ptable_tpl = {
'name': ptable['name'],
'layout': ptable['layout'],
'snippet': ptable['snippet'],
'audit_comment': ptable['audit-comment'],
'locked': ptable['locked'],
'os_family': ptable['os-family']
}
self.fm.ptables.create( ptable = ptable_tpl )
评论列表
文章目录