Change in ovirt-engine[master]: core: validate osinfo properties files - fail backend on error

rgolan at redhat.com rgolan at redhat.com
Wed Oct 1 11:12:45 UTC 2014


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 at 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 at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Frank Kobzik <fkobzik at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list