summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert JW Regeer <xistence@0x58.com>2015-11-12 22:32:08 -0700
committerBert JW Regeer <xistence@0x58.com>2015-11-12 22:32:08 -0700
commit2cb0419e3ebcfc4c6671d0325b7fb280bc986001 (patch)
treea5af7638c651a894ae87693e29b4b36319a248af
parentbd52b68df1c4a754a6cf3891c53c7b34812cc3be (diff)
parentbaff99d69e80c58a76e0b0e8cf444ee5e573208b (diff)
downloadpyramid-2cb0419e3ebcfc4c6671d0325b7fb280bc986001.tar.gz
pyramid-2cb0419e3ebcfc4c6671d0325b7fb280bc986001.tar.bz2
pyramid-2cb0419e3ebcfc4c6671d0325b7fb280bc986001.zip
Merge pull request #2120 from mmerickel/fix/pserve-deprecation-messages
improve pserve deprecation messages
-rw-r--r--CHANGES.txt8
-rw-r--r--pyramid/scripts/pserve.py23
2 files changed, 23 insertions, 8 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index a17c7e1e6..114bdc3a0 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -242,9 +242,10 @@ Bug Fixes
Deprecations
------------
-- The ``pserve`` command's daemonization features have been deprecated. This
- includes the ``[start,stop,restart,status]`` subcommands as well as the
- ``--daemon``, ``--stop-server``, ``--pid-file``, and ``--status`` flags.
+- The ``pserve`` command's daemonization features have been deprecated as well
+ as ``--monitor-restart``. This includes the ``[start,stop,restart,status]``
+ subcommands as well as the ``--daemon``, ``--stop-daemon``, ``--pid-file``,
+ and ``--status`` flags.
Please use a real process manager in the future instead of relying on the
``pserve`` to daemonize itself. Many options exist including your Operating
@@ -252,6 +253,7 @@ Deprecations
solutions like Circus and Supervisor.
See https://github.com/Pylons/pyramid/pull/1641
+ and https://github.com/Pylons/pyramid/pull/2120
- Renamed the ``principal`` argument to ``pyramid.security.remember()`` to
``userid`` in order to clarify its intended purpose.
diff --git a/pyramid/scripts/pserve.py b/pyramid/scripts/pserve.py
index 42b45640c..01d6383d6 100644
--- a/pyramid/scripts/pserve.py
+++ b/pyramid/scripts/pserve.py
@@ -69,6 +69,7 @@ class PServeCommand(object):
If start/stop/restart is given, then --daemon is implied, and it will
start (normal operation), stop (--stop-daemon), or do both.
+ Note: Daemonization features are deprecated.
You can also include variable assignments like 'http_port=8080'
and then use %(http_port)s in your config files.
@@ -100,13 +101,13 @@ class PServeCommand(object):
'--daemon',
dest="daemon",
action="store_true",
- help="Run in daemon (background) mode")
+ help="Run in daemon (background) mode [DEPRECATED]")
parser.add_option(
'--pid-file',
dest='pid_file',
metavar='FILENAME',
help=("Save PID to file (default to pyramid.pid if running in "
- "daemon mode)"))
+ "daemon mode) [DEPRECATED]"))
parser.add_option(
'--log-file',
dest='log_file',
@@ -127,7 +128,7 @@ class PServeCommand(object):
'--monitor-restart',
dest='monitor_restart',
action='store_true',
- help="Auto-restart server if it dies")
+ help="Auto-restart server if it dies [DEPRECATED]")
parser.add_option(
'-b', '--browser',
dest='browser',
@@ -137,7 +138,8 @@ class PServeCommand(object):
'--status',
action='store_true',
dest='show_status',
- help="Show the status of the (presumably daemonized) server")
+ help=("Show the status of the (presumably daemonized) server "
+ "[DEPRECATED]"))
parser.add_option(
'-v', '--verbose',
default=default_verbosity,
@@ -169,7 +171,7 @@ class PServeCommand(object):
dest='stop_daemon',
action='store_true',
help=('Stop a daemonized server (given a PID file, or default '
- 'pyramid.pid file)'))
+ 'pyramid.pid file) [DEPRECATED]'))
_scheme_re = re.compile(r'^[a-z][a-z]+:', re.I)
@@ -306,6 +308,17 @@ class PServeCommand(object):
raise ValueError(msg)
writeable_pid_file.close()
+ # warn before forking
+ if (
+ self.options.monitor_restart and
+ not os.environ.get(self._monitor_environ_key)
+ ):
+ self.out('''\
+--monitor-restart has been deprecated in Pyramid 1.6. It will be removed
+in a future release per Pyramid's deprecation policy. Please consider using
+a real process manager for your processes like Systemd, Circus, or Supervisor.
+''')
+
if (
getattr(self.options, 'daemon', False) and
not os.environ.get(self._monitor_environ_key)