[Grok-dev] buildout-generated config files in grokproject

Maurits van Rees m.van.rees at zestsoftware.nl
Thu Feb 5 14:51:20 EST 2009


Uli Fouquet, on 2009-02-05:
>
> Hi there,
>
> Just committed some changes into the grokproject-trunk that care for
> configuration files (i.e. the files in etc/ dir of a grok project) to be
> generated by ``zc.buildout`` (using Wicherts buildout-recipe) instead of
> being generated by grokproject itself. 
>
> This is, of course, not released yet.
>
> Projects now have a new subdirectory ``cfg_templates`` where all the
> templates for the configuration files are stored::
>
>   SampleProject/
>      + etc/  (now empty before running buildout)
>      + cfg_templates/
>           + README.txt (tells what purpose files in this dir have)
>           + deploy.ini.in
>           + debug.ini.in
>           + site.zcml.in
>           + zope.conf.in
>           + zdaemon.conf.in
>      + buildout.cfg
>      + setup.py
>      ...
>
> When running ``bin/buildout`` in a project, the templates are parsed,
> paths replaced according to the local environment and written to etc/.

Great!

> Before finishing this task, I would like to know, what you think about 
>
> * the template directory being placed in the project root (could there 
>   be a better place?),

Fine.

> * the name of the directory (could there be a shorter name?)

Fine.  Perhaps etc_templates, but that would imply that all of them
will be copied to etc whereas in the future there may be some
templates that would be copied elsewhere.

> * the set of config files stored (only zope.conf, zdaemon.conf have 
>   paths replaced; the other templates are copied as-is)

Fine.  Having some config files in etc/ that are generated by
grokproject and some that are generated by bin/buildout would probably
just confuse users.


So in general: well done, thanks!

But I get this error on startup of a newly created grok project:

$ bin/bar-ctl fg
bin/paster serve /home/maurits/svn/grokproject/bar #end raw /etc/deploy.ini
Variable assignment '#end' invalid (no "=")

When I change zdaemon.conf.in to have that 'end raw' comment on the
next line, run bin/buildout and try 'bin/bar-ctl fg' again, I get:

=========================================================================
bin/paster serve /home/maurits/svn/grokproject/bar
Traceback (most recent call last):
  File "bin/paster", line 127, in ?
    paste.script.command.run()
  File "/home/maurits/shared-eggs/PasteScript-1.7.3-py2.4.egg/paste/script/command.py", line 84, in run
    invoke(command, command_name, options, args[1:])
  File "/home/maurits/shared-eggs/PasteScript-1.7.3-py2.4.egg/paste/script/command.py", line 123, in invoke
    exit_code = runner.run(args)
  File "/home/maurits/shared-eggs/PasteScript-1.7.3-py2.4.egg/paste/script/command.py", line 218, in run
    result = self.command()
  File "/home/maurits/shared-eggs/PasteScript-1.7.3-py2.4.egg/paste/script/serve.py", line 274, in command
    relative_to=base, global_conf=vars)
  File "/home/maurits/shared-eggs/PasteScript-1.7.3-py2.4.egg/paste/script/serve.py", line 308, in loadserver
    relative_to=relative_to, **kw)
  File "/home/maurits/shared-eggs/PasteDeploy-1.3.2-py2.4.egg/paste/deploy/loadwsgi.py", line 210, in loadserver
    return loadobj(SERVER, uri, name=name, **kw)
  File "/home/maurits/shared-eggs/PasteDeploy-1.3.2-py2.4.egg/paste/deploy/loadwsgi.py", line 224, in loadobj
    global_conf=global_conf)
  File "/home/maurits/shared-eggs/PasteDeploy-1.3.2-py2.4.egg/paste/deploy/loadwsgi.py", line 248, in loadcontext
    global_conf=global_conf)
  File "/home/maurits/shared-eggs/PasteDeploy-1.3.2-py2.4.egg/paste/deploy/loadwsgi.py", line 278, in _loadconfig
    return loader.get_context(object_type, name, global_conf)
  File "/home/maurits/shared-eggs/PasteDeploy-1.3.2-py2.4.egg/paste/deploy/loadwsgi.py", line 362, in get_context
    section = self.find_config_section(
  File "/home/maurits/shared-eggs/PasteDeploy-1.3.2-py2.4.egg/paste/deploy/loadwsgi.py", line 524, in find_config_section
    raise LookupError(
LookupError: No section 'main' (prefixed by 'server') found in config /home/maurits/svn/grokproject/bar
=========================================================================

I don't know enough about 'paster serve' to quickly see how to fix this.

-- 
Maurits van Rees | http://maurits.vanrees.org/
            Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]



More information about the Grok-dev mailing list