mirror of
https://git.proxmox.com/git/proxmox
synced 2025-10-25 16:53:46 +00:00
section_config: fixup fallback schema in parse
we also have to fallback to the id_schema of the section_config when we parse it, not only on write Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
456e6eaa0b
commit
b1fd556f3b
@ -333,10 +333,12 @@ impl SectionConfig {
|
||||
if let Some((section_type, section_id)) = (self.parse_section_header)(line) {
|
||||
//println!("OKLINE: type: {} ID: {}", section_type, section_id);
|
||||
if let Some(ref plugin) = self.plugins.get(§ion_type) {
|
||||
if let Some(id_schema) = plugin.get_id_schema() {
|
||||
if let Err(err) = parse_simple_value(§ion_id, id_schema) {
|
||||
bail!("syntax error in section identifier: {}", err.to_string());
|
||||
}
|
||||
let id_schema = match plugin.get_id_schema() {
|
||||
Some(schema) => schema,
|
||||
None => self.id_schema,
|
||||
};
|
||||
if let Err(err) = parse_simple_value(§ion_id, id_schema) {
|
||||
bail!("syntax error in section identifier: {}", err.to_string());
|
||||
}
|
||||
state = ParseState::InsideSection(plugin, section_id, json!({}));
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user