[Wellington-pm] Complex config files

Christopher Eade Christopher.Eade at maf.govt.nz
Wed May 13 18:33:40 PDT 2009


I think YAML doesn't like tabs, which some editors like to automatically
do when indenting stuff.
Something to watch out for :)
Cheers,
Chris.

-----Original Message-----
From: wellington-pm-bounces+christopher.eade=maf.govt.nz at pm.org
[mailto:wellington-pm-bounces+christopher.eade=maf.govt.nz at pm.org] On
Behalf Of Srdjan
Sent: Thursday, 14 May 2009 1:27 p.m.
To: Wellington Perl Mongers (Perl user group)
Subject: Re: [Wellington-pm] Complex config files

I'm not sure it is recommended to edit a YAML file, I think it is
possible to introduce invisible errors. But there's a number of
Config::* modules, and of course venerable Dumper -> eval solution.

Martyn Smith wrote:
> Your new format looks very close to YAML :-) (see the YAML) module
>
> Perhaps you just want to use that as your config format?
>
> On Thu, May 14, 2009 at 01:13:32PM +1200, Lesley Longhurst wrote:
>   
>> Hi all,
>> Some of you may remember a while ago I brought in some code from work

>> to talk about, and it was based around a truly hideous config file.
>>
>> I'm now working on replacing some of that stuff with a new script, 
>> and the time has come to invent a better config file format. So, I'm 
>> interested in recommendations for a good module to use for reading 
>> and writing complex config files.
>>
>> Ideally, such a module would meet the following requirements:
>> - well-documented
>> - currently supported
>> - a usable version available in a Debian package for Etch
>>
>> and the config file itself needs to
>> - be easily read and edited by humans
>> - support repeated sub-sections
>> - allow multiple entries for parameters within the same section and 
>> sub-section
>> - allow for lots of comments
>>
>> Any suggestions?
>>
>> By way of example, I've attached a first cut of the sort of thing I'm

>> thinking of (and for your amusement I've also attached a fragment of 
>> the existing config file that I derived it from.)
>>
>>
>> --
>> Lesley Longhurst (previously Walker)
>> Linux Systems Administrator
>> Opus International Consultants Ltd
>> Email lesley.longhurst at opus.co.nz
>> Tel +64 4 471 7002, Fax +64 4 473 3017 http://www.opus.co.nz Level 9

>> Majestic Centre, 100 Willis Street, PO Box 12 343 Wellington, New 
>> Zealand
>>
>>
>>     
>
>   
>> # 
>> ---------------------------------------------------------------------
>> ---
>> # <informational comments etc>
>> # 
>> ---------------------------------------------------------------------
>> --- Hosts,"COMMON UTILS",<an external command that generates a list> 
>> Include(zzsv01|zysv01),,--delete,"Utils",office/branchapp/cad_deploy/
>> utils
>>
>> Include(zzsv01),,--delete,"OpusCAD partial 
>> menu",office/branchapp/opuscad Include(zysv01),,--delete,"Standard 
>> AutoCAD",office/branchapp/acad
>>
>> # -- OpusNetSoftwareUpdateEngine (SUE) - 50M # SUE is needed by sites

>> that use Microstran or Google Sketchup.
>> # Since it's small and developed in-house, it can go to all BOS 
>> servers 
>> Include,,--delete,"SUE",office/branchapp/OpusNetSoftwareUpdateEngine
>>
>> # 
>> ---------------------------------------------------------------------
>> ---
>> # <informational comments etc>
>> # 
>> ---------------------------------------------------------------------
>> ---
>> # -- dwgtrueconvert2007 - 34M
>> Hosts,"DWG VIEWERS ETC FOR ALL",<an external command that generates a

>> list>,(zzsv01),(zysv01)
>> Include,,--delete,"dwgtrueconvert2007",office/branchapp/cad_deploy/dw
>> gtrueconvert2007
>> Exclude,,,,office/branchapp/cad_deploy/dwgtrueconvert2007/AdminImage/
>> Log/* 
>> Include,,,,office/branchapp/cad_deploy/dwgtrueconvert2007/AdminImage/
>> Log/some.file.or.other
>>
>> # -- dwgtrueview2009 - 195M
>> Include,,--delete,"dwgtrueview2009",office/branchapp/cad_deploy/dwgtr
>> ueview2009
>> Exclude,,,,office/branchapp/cad_deploy/dwgtrueview2009/AdminImage/Log
>> /*
>>
>> # -- object_enablers - 47M
>> Include,,--delete,"object_enablers",office/branchapp/cad_deploy/objec
>> t_enablers
>> Exclude,,,,office/branchapp/cad_deploy/object_enablers/AdminImage/Log
>> /*
>>     
>
>   
>> # 
>> ---------------------------------------------------------------------
>> ---
>> # <informational comments etc>
>> #
------------------------------------------------------------------------
>> label:       COMMON UTILS
>>     servers: <an external command that generates a list>
>>
>>     include:    office/branchapp/cad_deploy/utils
>>         description: Utils
>>         rsync_flags: --delete
>>         exclude-server: zzsv01
>>         exclude-server: zysv01
>>
>>     include:    office/branchapp/opuscad
>>         description: OpusCAD partial menu
>>         rsync_flags: --delete
>>         exclude-server: zzsv01
>>
>>     include:    office/branchapp/acad
>>         description: Standard AutoCAD
>>         rsync_flags: --delete
>>         exclude-server: zysv01
>>
>>     include:    office/branchapp/OpusNetSoftwareUpdateEngine
>>         description: OpusNetSoftwareUpdateEngine (SUE)
>>         comment:     SUE is needed by sites that use Microstran or
Google Sketchup.
>>         comment:     Since it's small and developed in-house, it can
go to all BOS servers
>>         size:        50M
>>         rsync_flags: --delete
>>
>> # 
>> ---------------------------------------------------------------------
>> ---
>> # <informational comments etc>
>> #
------------------------------------------------------------------------
>> label:       DWG VIEWERS ETC FOR ALL
>>     servers:        <an external command that generates a list>
>>     servers:        <whitespace-separated list>
>>     exclude-server: zzsv01
>>     exclude-server: zysv01
>>
>>     include:    office/branchapp/cad_deploy/dwgtrueconvert2007
>>         description: dwgtrueconvert2007
>>         size:        34M
>>         rsync_flags: --delete
>>         exclude:
office/branchapp/cad_deploy/dwgtrueconvert2007/AdminImage/Log/*
>>         include:
office/branchapp/cad_deploy/dwgtrueconvert2007/AdminImage/Log/some.file.
or.other
>>
>>     include:    office/branchapp/cad_deploy/dwgtrueview2009
>>         description: dwgtrueview2009
>>         size:        195M
>>         rsync_flags: --delete
>>         exclude:
office/branchapp/cad_deploy/dwgtrueview2009/AdminImage/Log/*
>>
>>     include:    office/branchapp/cad_deploy/object_enablers
>>         description: object_enablers
>>         size:        47M
>>         rsync_flags: --delete
>>         exclude:
office/branchapp/cad_deploy/object_enablers/AdminImage/Log/*
>>     
>
>   
>> _______________________________________________
>> Wellington-pm mailing list
>> Wellington-pm at pm.org
>> http://mail.pm.org/mailman/listinfo/wellington-pm
>>     
>
>   
_______________________________________________
Wellington-pm mailing list
Wellington-pm at pm.org
http://mail.pm.org/mailman/listinfo/wellington-pm
########################################################################
This email message and any attachment(s) is intended solely for the
addressee(s) named above. The information it contains is confidential
and may be legally privileged.  Unauthorised use of the message, or the
information it contains, may be unlawful. If you have received this
message by mistake please call the sender immediately on 64 4 8940100
or notify us by return email and erase the original message and
attachments. Thank you.

The Ministry of Agriculture and Forestry accepts no responsibility for
changes made to this email or to any attachments after transmission from
the office.
########################################################################


More information about the Wellington-pm mailing list