[PATCH 1 of 7] [pyramid/ctl] pyramid command will always run in foreground from now on

Laurent Peuch cortex at worlddomination.be
Tue Sep 17 15:53:17 CEST 2019


On Thu, Sep 05, 2019 at 04:26:26PM +0200, Denis Laxalde wrote:
> Laurent Peuch a écrit :
> > # HG changeset patch
> > # User Laurent Peuch <cortex at worlddomination.be>
> > # Date 1558480615 -7200
> > #      Wed May 22 01:16:55 2019 +0200
> > # Node ID a63c93f27994cbb440a0431c1809166216eaa712
> > # Parent  1a5eb9a9f5b42fe7dd5f5fc38f3007a884d0a49d
> > [pyramid/ctl] pyramid command will always run in foreground from now on
> > 
> > Daemonization used to make sens in the past, but today "pyramid" command is
> > only used for dev and should never be used for deployement (you should use a
> > wsgi server for that instead) so daemonization doesn't fit any use case
> > anymore.
> > 
> > Closes #17232923
> > 
> > diff --git a/cubicweb/pyramid/pyramidctl.py b/cubicweb/pyramid/pyramidctl.py
> > --- a/cubicweb/pyramid/pyramidctl.py
> > +++ b/cubicweb/pyramid/pyramidctl.py
> 
> > @@ -97,18 +96,14 @@ class PyramidStartHandler(InstanceComman
> >      name = 'pyramid'
> >      actionverb = 'started'
> >  
> > -    options = (
> > -        ('no-daemon',
> > -         {'action': 'store_true',
> > -          'help': 'Run the server in the foreground.'}),
> > +    options = merge_options((
> 
> Is introduction of merge_options() related to the "foreground" thing? (I
> do think it's useless to solve some problems currently pending in the
> default branch, but it seems unrelated here.)

Ah, that's probably a remaning of yet another zillion on
merging/splitting/fixing/re-ordering of this serie of patches, I think
that's for a patch after this one.

> >          ('debug-mode',
> >           {'action': 'store_true',
> >            'help': 'Activate the repository debug mode ('
> > -                  'logs in the console and the debug toolbar).'
> > -                  ' Implies --no-daemon'}),
> > +                  'logs in the console and the debug toolbar).'}),
> >          ('debug',
> >           {'short': 'D', 'action': 'store_true',
> > -          'help': 'Equals to "--debug-mode --no-daemon --reload"'}),
> > +          'help': 'Equals to "--debug-mode --reload"'}),
> >          ('reload',
> >           {'action': 'store_true',
> >            'help': 'Restart the server if any source file is changed'}),
> > @@ -148,7 +143,7 @@ class PyramidStartHandler(InstanceComman
> >            'metavar': 'key1:value1,key2:value2',
> >            'default': {},
> >            'help': 'override <key> configuration file option with <value>.'}),
> > -    )
> > +    ) + InstanceCommand.options)
> >  
> >      _reloader_environ_key = 'CW_RELOADER_SHOULD_RUN'
> >  
> 
> > diff --git a/cubicweb/pyramid/test/test_ctl.py b/cubicweb/pyramid/test/test_ctl.py
> > new file mode 100644
> > --- /dev/null
> > +++ b/cubicweb/pyramid/test/test_ctl.py
> 
> Hm, these tests actually check that the "features" your removed are no
> longer present. This seems a bit overzealous to me. Are you attached to
> them?

No, we can ditch them if needed.

-- 

Laurent Peuch -- Bram



More information about the cubicweb-devel mailing list