Roy Golan has submitted this change and it was merged.
Change subject: core: validate osinfo properties files - fail backend on error
......................................................................
core: validate osinfo properties files - fail backend on error
validate the osinfo properties files by the order of loading.
on-error, a RuntimeException is thrown, which should fail the backend
from loading.
The parsing itself is implemented using ANTLR parser and lexer
generator and the Osinfo.g4 grammar file.
Osinfo.g4
grammar file that expresses the syntax of the properties file and
except for unique validation needs should be the only place to be
changed when needed.
OsinfoPreferencesParser.java
the tool to parse a property file with and match is against the syntax
OsinfoPreferencesParser.parse("path/to/file")
Change-Id: Ie33bf9446857e15d13221271120a3ff2b400350c
Bug-Url:
https://bugzilla.redhat.com/1056965
Signed-off-by: Roy Golan <rgolan(a)redhat.com>
---
M backend/manager/dependencies/pom.xml
A backend/manager/dependencies/src/main/modules/org/antlr/antlr4-runtime/main/module.xml
M
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/osinfo/OsRepository.java
M backend/manager/modules/utils/exclude-filters.xml
M backend/manager/modules/utils/pom.xml
A
backend/manager/modules/utils/src/main/antlr4/org/ovirt/engine/core/utils/osinfo/Osinfo.g4
M
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/osinfo/OsInfoPreferencesLoader.java
A
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/osinfo/OsinfoPropertiesParser.java
M
backend/manager/modules/utils/src/main/modules/org/ovirt/engine/core/utils/main/module.xml
M
backend/manager/modules/utils/src/test/resources/osinfo.conf.d/00-osinfo-test.properties
M pom.xml
11 files changed, 322 insertions(+), 5 deletions(-)
Approvals:
Roy Golan: Verified
Omer Frenkel: Looks good to me, approved
--
To view, visit
http://gerrit.ovirt.org/30782
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie33bf9446857e15d13221271120a3ff2b400350c
Gerrit-PatchSet: 11
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Roy Golan <rgolan(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Frank Kobzik <fkobzik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel(a)redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan(a)redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server