glideinWMS ini file validations


The parser used to read and validate the glideinWMS ini file is based on the Python 2.4.+ ConfigParser module. The ConfigParser module performs some elementary validations, there are some additional validations that are required in order to reduce user error and insure data integrity for the installation process. These validations are performed by GLIDEIN_SRC/install/services/ module (class).

The can be executed from the command line and has several options available:

Usage: ./ --compare file1 file2
       ./ --show-options file
       ./ --show-values file
       ./ --validate file
       ./ --help | -h 

   compare .......... Shows the differences between the 
                      section/objects (not values) of the 2 ini files
                        returns 0 if identical
                        returns 1 if any differences
   show-options ...... Shows the section/objects for the ini file
   show-values ....... Shows the section/objects/values for the ini file
   validate .......... Verifies the ini file has no syntax errors

   Full path to the files must be specified unless this is executed
   in the directory in which they reside.

Important: This module only performs a syntactical check of the ini file.

There are some additional validations performed to minimize user error for the glideinWMS application described in the following sections.

Syntax rules

The following are the rules for a valid ini file:
    • Any line beginning (no preceding whitespace) with a ';' or '#' is considered a comment line and ignored.
    • In-line comments using ';' or "#' must be preceded by whitespace or they will be considered part of the option's value.
  2. Sections and option lines must start in the 1st position on the line (no preceding whitespace) or they will be considered part of the previous option.

Some of these validations are handle by the ConfigParser? module and some additional validations are performed to minimize user error for the glideinWMS application. These are described in the sections that follow.

Duplicate section validations

If multiple sections are defined with the same name, the python ConfigParser will use the last one it finds sequentially in the file.
option_a = xxxxx
option_b = yyyyy
The parser will only show:
option_b = yyyyy

The module will perform an additional validation and error on this condition indicating the duplicate sections.

In addition, it will treat the following variations as duplicates where the python ConfigParser would treat them as independent sections.

[  WMSCollector  ]
[WMSCollector  ]
[  WMSCollector]

Invalid preceding whitespace

As mention in the syntax rules, a line should not start with whitespace. The ConfigParser? does not validate this. This additional validation is performed by the installer.

-- JohnWeigand - 2010/11/30

Topic revision: r3 - 2011/01/04 - 20:11:32 - JohnWeigand
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback