[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: nested entries in a configuration file
- From: Jon Akhtar <akhtar@...>
- Date: Thu, 24 Feb 2011 14:15:05 -0500
On Thu, Feb 24, 2011 at 1:01 PM, Henderson, Michael D
<michael.d.henderson@lmco.com> wrote:
> I'm having trouble figuring out a best way to write a configuration file with Lua.
>
> I think that something like
>
> batch@raw
> dev = account { host = 'rawdev' , name = 'batch01', instance = 'raw' }
> test = account { host = 'rawtest', name = 'batch11', instance = 'raw' }
> prod = account { host = 'rawprod', name = 'batch21', instance = 'raw' }
> batch@staging
> dev = account { host = 'stgdev' , name = 'batch02', instance = 'staging' }
> test = account { host = 'stgtest', name = 'batch12', instance = 'staging' }
> prod = account { host = 'stgprod', name = 'batch22', instance = 'staging' }
>
> would work but that's no longer a configuration file written in Lua.
>
database {
['batch@raw'] = {
dev = account { host = 'rawdev' , name = 'batch01', instance = 'raw' },
test = account { host = 'rawtest', name = 'batch11', instance = 'raw' },
prod = account { host = 'rawprod', name = 'batch21', instance = 'raw' },
},
['batch@staging'] = {
dev = account { host = 'stgdev' , name = 'batch02', instance = 'staging' },
test = account { host = 'stgtest', name = 'batch12', instance = 'staging' },
prod = account { host = 'stgprod', name = 'batch22', instance = 'staging' },
},
}