Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate pserve --user and --group options #2190

Merged
merged 2 commits into from
Dec 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
unreleased
==========

Deprecations
------------

- Continue removal of ``pserve`` daemon/process management features
by deprecating ``--user`` and ``--group`` options.
See https://github.com/Pylons/pyramid/pull/2190

1.6b3 (2015-12-17)
==================

Expand Down
18 changes: 13 additions & 5 deletions pyramid/scripts/pserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ def run(self): # pragma: no cover
self.options.set_user = self.options.set_group = None

# @@: Is this the right stage to set the user at?
self.change_user_group(
self.options.set_user, self.options.set_group)
if self.options.set_user or self.options.set_group:
self.change_user_group(
self.options.set_user, self.options.set_group)

if not self.args:
self.out('You must give a config file')
Expand Down Expand Up @@ -620,9 +621,16 @@ def restart_with_monitor(self, reloader=False): # pragma: no cover
self.out('%s %s %s' % ('-' * 20, 'Restarting', '-' * 20))

def change_user_group(self, user, group): # pragma: no cover
if not user and not group:
return
import pwd, grp
import pwd
import grp

self.out('''\
The --user and --group options have been deprecated in Pyramid 1.6. They 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, all of which support process security.
''')

uid = gid = None
if group:
try:
Expand Down