[Zope-Checkins] SVN: zdaemon/trunk/ Fixed: the status command didn't return a non-zero exit status when
Log message for revision 128449: Fixed: the status command didn't return a non-zero exit status when the program wasn't running. This made it impossible for other software (e.g. Puppet) to tell if a process was running. Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/src/zdaemon/README.txt U zdaemon/trunk/src/zdaemon/tests/tests.py U zdaemon/trunk/src/zdaemon/zdctl.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-11-27 18:10:32 UTC (rev 128448) +++ zdaemon/trunk/CHANGES.txt 2012-11-27 22:37:20 UTC (rev 128449) @@ -2,6 +2,13 @@ Change log == +3.0.5 (2012-11-27) +== + +- Fixed: the status command didn't return a non-zero exit status when + the program wasn't running. This made it impossible for other + software (e.g. Puppet) to tell if a process was running. + 3.0.4 (2012-07-30) == Modified: zdaemon/trunk/src/zdaemon/README.txt === --- zdaemon/trunk/src/zdaemon/README.txt2012-11-27 18:10:32 UTC (rev 128448) +++ zdaemon/trunk/src/zdaemon/README.txt2012-11-27 22:37:20 UTC (rev 128449) @@ -72,6 +72,7 @@ sh> ./zdaemon -p 'sleep 100' status daemon manager not running +Failed: 3 Normally, we control zdaemon using a configuration file. Let's create a typical configuration file:: Modified: zdaemon/trunk/src/zdaemon/tests/tests.py === --- zdaemon/trunk/src/zdaemon/tests/tests.py2012-11-27 18:10:32 UTC (rev 128448) +++ zdaemon/trunk/src/zdaemon/tests/tests.py2012-11-27 22:37:20 UTC (rev 128449) @@ -143,6 +143,7 @@ >>> system("./zdaemon -Cconf status") daemon manager not running +Failed: 3 """ Modified: zdaemon/trunk/src/zdaemon/zdctl.py === --- zdaemon/trunk/src/zdaemon/zdctl.py 2012-11-27 18:10:32 UTC (rev 128448) +++ zdaemon/trunk/src/zdaemon/zdctl.py 2012-11-27 22:37:20 UTC (rev 128449) @@ -420,18 +420,21 @@ print "wait -- Wait for the daemon process to exit." def do_status(self, arg=""): +status = 0 if arg not in ["", "-l"]: print "status argument must be absent or -l" -return +return 1 self.get_status() if not self.zd_up: print "daemon manager not running" +status = 3 elif not self.zd_pid: print "daemon manager running; daemon process not running" else: print "program running; pid=%d" % self.zd_pid if arg == "-l" and self.zd_status: print self.zd_status +return status def help_status(self): print "status [-l] -- Print status for the daemon process." ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/ Fixed: The start command exited with a zero exit status even when
Log message for revision 127404: Fixed: The start command exited with a zero exit status even when the program being started failed to start (or exited imediately). Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/src/zdaemon/tests/tests.py U zdaemon/trunk/src/zdaemon/tests/testuser.py U zdaemon/trunk/src/zdaemon/zdctl.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-07-30 13:59:51 UTC (rev 127403) +++ zdaemon/trunk/CHANGES.txt 2012-07-30 17:47:14 UTC (rev 127404) @@ -2,6 +2,12 @@ Change log == +3.0.4 (2012-07-30) +== + +- Fixed: The start command exited with a zero exit status even when + the program being started failed to start (or exited imediately). + 3.0.3 (2012-07-10) == Modified: zdaemon/trunk/src/zdaemon/tests/tests.py === --- zdaemon/trunk/src/zdaemon/tests/tests.py2012-07-30 13:59:51 UTC (rev 127403) +++ zdaemon/trunk/src/zdaemon/tests/tests.py2012-07-30 17:47:14 UTC (rev 127404) @@ -78,6 +78,7 @@ >>> system("./zdaemon -Cconf start") . . daemon manager not running +Failed: 1 """ @@ -267,7 +268,49 @@ True """ +def nonzeo_exit_on_program_failure(): +""" +>>> write('conf', +... ''' +... +... backoff-limit 1 +... program nosuch +... +... ''') +>>> system("./zdaemon -Cconf start", echo=True) # doctest: +ELLIPSIS +./zdaemon... +daemon manager not running +Failed: 1 + +>>> write('conf', +... ''' +... +... backoff-limit 1 +... program cat nosuch +... +... ''') + +>>> system("./zdaemon -Cconf start", echo=True) # doctest: +ELLIPSIS +./zdaemon... +daemon manager not running +Failed: 1 + +>>> write('conf', +... ''' +... +... backoff-limit 1 +... program pwd +... +... ''') + +>>> system("./zdaemon -Cconf start", echo=True) # doctest: +ELLIPSIS +./zdaemon... +daemon manager not running +Failed: 1 + +""" + def setUp(test): test.globs['_td'] = td = [] here = os.getcwd() @@ -292,7 +335,9 @@ for f in test.globs['_td']: f() -def system(command, input='', quiet=False): +def system(command, input='', quiet=False, echo=False): +if echo: +print command p = subprocess.Popen( command, shell=True, stdin=subprocess.PIPE, Modified: zdaemon/trunk/src/zdaemon/tests/testuser.py === --- zdaemon/trunk/src/zdaemon/tests/testuser.py 2012-07-30 13:59:51 UTC (rev 127403) +++ zdaemon/trunk/src/zdaemon/tests/testuser.py 2012-07-30 17:47:14 UTC (rev 127404) @@ -83,7 +83,8 @@ ... O(gr_gid=7, gr_mem =['h', ]), ... ] ->>> zdaemon.zdctl.main(['-C', 'conf', 'status']) +>>> with mock.patch('sys.exit'): +... zdaemon.zdctl.main(['-C', 'conf', 'status']) daemon manager not running >>> import pwd, os @@ -108,6 +109,7 @@ ... ''') >>> with mock.patch('os.geteuid') as geteuid: +... with mock.patch('sys.exit'): ... geteuid.return_value = 99 ... zdaemon.zdctl.main(['-C', 'conf', 'status']) ... os.geteuid.assert_called_with() Modified: zdaemon/trunk/src/zdaemon/zdctl.py === --- zdaemon/trunk/src/zdaemon/zdctl.py 2012-07-30 13:59:51 UTC (rev 127403) +++ zdaemon/trunk/src/zdaemon/zdctl.py 2012-07-30 17:47:14 UTC (rev 127404) @@ -267,7 +267,7 @@ was_running = True elif (was_running or n > 10) and not cond(n): print "\ndaemon manager not running" -return +return 1 except KeyboardInterrupt: print "^C" @@ -318,9 +318,8 @@ print "daemon process already running; pid=%d" % self.zd_pid return if self.options.daemon: -self.awhile(self._start_cond, -"daemon process started, pid=%(zd_pid)d", -) +return self.awhile( +self._start_cond, "daemon process started, pid=%(zd_pid)d") def _get_override(self, opt, name, svalue=None, flag=0): value = getattr(self.options, name) @@ -611,7 +610,7 @@ options = ZDCtlOptions() options.realize(args) c = cmdclass(options) -c.onecmd(" ".join(options.args)) +sys.exit(c.onecmd(" ".join(options.args))) if __name__ == "__main__": main() ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/ - Fixed: programs started with zdaemon couldn't, themselves, invoke
Log message for revision 127309: - Fixed: programs started with zdaemon couldn't, themselves, invoke zdaemon. really Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/src/zdaemon/tests/tests.py U zdaemon/trunk/src/zdaemon/zdctl.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-07-10 16:46:05 UTC (rev 127308) +++ zdaemon/trunk/CHANGES.txt 2012-07-10 18:05:19 UTC (rev 127309) @@ -2,12 +2,17 @@ Change log == -3.0.2 (2012-07-10) +3.0.3 (2012-07-10) == - Fixed: programs started with zdaemon couldn't, themselves, invoke zdaemon. +3.0.2 (2012-07-10) +== + +Fail :( + 3.0.1 (2012-06-08) == Modified: zdaemon/trunk/src/zdaemon/tests/tests.py === --- zdaemon/trunk/src/zdaemon/tests/tests.py2012-07-10 16:46:05 UTC (rev 127308) +++ zdaemon/trunk/src/zdaemon/tests/tests.py2012-07-10 18:05:19 UTC (rev 127309) @@ -42,6 +42,10 @@ with open(name, 'w') as f: f.write(text) +def read(name): +with open(name) as f: +return f.read() + def make_sure_non_daemon_mode_doesnt_hang_when_program_exits(): """ The whole awhile bit that waits for a program to start @@ -243,6 +247,27 @@ daemon process stopped """ +def DAEMON_MANAGER_MODE_leak(): +""" +Zdaemon used an environment variable to flag that it's running in +daemon-manager mode, as opposed to UI mode. If this environment +variable is allowed to leak to the program, them the program will +be unable to invoke zdaemon correctly. + +>>> write('c', ''' +... +... program env +... transcript t +... +... ''') + +>>> system('./zdaemon -b0 -T1 -Cc start', quiet=True) +Failed: 1 +>>> 'DAEMON_MANAGER_MODE' not in read('t') +True +""" + + def setUp(test): test.globs['_td'] = td = [] here = os.getcwd() Modified: zdaemon/trunk/src/zdaemon/zdctl.py === --- zdaemon/trunk/src/zdaemon/zdctl.py 2012-07-10 16:46:05 UTC (rev 127308) +++ zdaemon/trunk/src/zdaemon/zdctl.py 2012-07-10 18:05:19 UTC (rev 127309) @@ -603,6 +603,7 @@ args = sys.argv[1:] if os.environ.get('DAEMON_MANAGER_MODE'): +del os.environ['DAEMON_MANAGER_MODE'] import zdaemon.zdrun return zdaemon.zdrun.main(args) ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/ Fixed:
Log message for revision 126699: Fixed: The change in 2.0.6 to set a user's supplemental groups broke common configurations in which the effective user was set via ``su`` or ``sudo -u`` prior to invoking zdaemon. Now, zdaemon doesn't set groups or the effective user if the effective user is already set to the configured user. Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/src/zdaemon/tests/testuser.py U zdaemon/trunk/src/zdaemon/zdctl.py U zdaemon/trunk/src/zdaemon/zdoptions.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-06-08 17:20:55 UTC (rev 126698) +++ zdaemon/trunk/CHANGES.txt 2012-06-08 17:52:02 UTC (rev 126699) @@ -1,10 +1,22 @@ -=== - Change log -=== +== +Change log +== -3.0.0 (unreleased) +3.0.1 (2012-06-08) == +- Fixed: + + The change in 2.0.6 to set a user's supplemental groups broke common + configurations in which the effective user was set via ``su`` or + ``sudo -u`` prior to invoking zdaemon. + + Now, zdaemon doesn't set groups or the effective user if the + effective user is already set to the configured user. + +3.0.0 (2012-06-08) +== + - Added an option, ``start-test-program`` to supply a test command to test whether the program managed by zdaemon is up and operational, rather than just running. When starting a program, the start Modified: zdaemon/trunk/src/zdaemon/tests/testuser.py === --- zdaemon/trunk/src/zdaemon/tests/testuser.py 2012-06-08 17:20:55 UTC (rev 126698) +++ zdaemon/trunk/src/zdaemon/tests/testuser.py 2012-06-08 17:52:02 UTC (rev 126699) @@ -96,10 +96,36 @@ """ +def test_do_nothing_if_effective_user_is_configured_user(): +""" + +>>> write('conf', +... ''' +... +... program sleep 9 +... user zope +... +... ''') + +>>> with mock.patch('os.geteuid') as geteuid: +... geteuid.return_value = 99 +... zdaemon.zdctl.main(['-C', 'conf', 'status']) +... os.geteuid.assert_called_with() +daemon manager not running + +>>> import pwd, os, grp +>>> pwd.getpwnam.assert_called_with('zope') +>>> _ = grp.getgrall.assert_not_called() +>>> _ = os.setuid.assert_not_called() +>>> _ = os.setgid.assert_not_called() +>>> _ = os.setgroups.assert_not_called() + +""" + def setUp(test): setupstack.setUpDirectory(test) getpwname = setupstack.context_manager(test, mock.patch('pwd.getpwnam')) -getpwname.return_value = O(pw_gid=5, pw_uid=99) +getpwname.return_value = O(pw_gid=5, pw_uid=99, pw_name='zope') setupstack.context_manager(test, mock.patch('os.geteuid')).return_value = 0 setupstack.context_manager(test, mock.patch('grp.getgrall')) setupstack.context_manager(test, mock.patch('os.setgroups')) Modified: zdaemon/trunk/src/zdaemon/zdctl.py === --- zdaemon/trunk/src/zdaemon/zdctl.py 2012-06-08 17:20:55 UTC (rev 126698) +++ zdaemon/trunk/src/zdaemon/zdctl.py 2012-06-08 17:52:02 UTC (rev 126699) @@ -166,15 +166,43 @@ os.chown(directory, self.options.uid, self.options.gid) def set_uid(self): -if self.options.uid is None: +user = self.options.user +if user is None: return -uid = os.geteuid() -if uid != 0 and uid != self.options.uid: -self.options.usage("only root can use -u USER to change users") -os.setgid(self.options.gid) -os.setgroups(self.options.groups) -os.setuid(self.options.uid) +import pwd +try: +uid = int(user) +except ValueError: +try: +pwrec = pwd.getpwnam(user) +except KeyError: +self.options.usage("username %r not found" % user) +uid = pwrec.pw_uid +else: +try: +pwrec = pwd.getpwuid(uid) +except KeyError: +self.options.usage("uid %r not found" % user) + +# See if we're already that user: +euid = os.geteuid() +if euid != 0: +if euid != uid: +self.options.usage("only root can use -u USER to change users") +return + +# OK, we have to set user and groups: +os.setgid(pwrec.pw_gid) + +import grp +user = pwrec.pw_name +os.setgroups( +sorted(g.gr_gid for g in grp.getgrall() # sort for tests + if user in g.gr_mem) +) +os.setuid(uid) + def emptyline(self): # We don't want a blank line to repeat the last command. # Showing status is a nice alternative. Modified: zdaemon/trunk/src/zdaemon/zdoptions.py =
[Zope-Checkins] SVN: zdaemon/trunk/ Fixed: When the ``user`` option was used to run as a particular
Log message for revision 126681: Fixed: When the ``user`` option was used to run as a particular user, supplemental groups weren't set to the user's supplemental groups. Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/README.txt U zdaemon/trunk/setup.py A zdaemon/trunk/src/zdaemon/tests/testuser.py U zdaemon/trunk/src/zdaemon/zdctl.py U zdaemon/trunk/src/zdaemon/zdoptions.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-06-07 20:34:56 UTC (rev 126680) +++ zdaemon/trunk/CHANGES.txt 2012-06-07 20:52:43 UTC (rev 126681) @@ -22,7 +22,18 @@ Previously, this was controlled by backoff-limit, which didn't make much sense. +2.0.6 (2012-06-07) +== +- Fixed: When the ``user`` option was used to run as a particular + user, supplemental groups weren't set to the user's supplemental + groups. + +2.0.5 (2012-06-07) +== + +(Accidental release. Please ignore.) + 2.0.4 (2009-04-20) == Modified: zdaemon/trunk/README.txt === --- zdaemon/trunk/README.txt2012-06-07 20:34:56 UTC (rev 126680) +++ zdaemon/trunk/README.txt2012-06-07 20:52:43 UTC (rev 126681) @@ -2,10 +2,7 @@ ``zdaemon`` process controller for Unix-based systems * -`zdaemon` is a Python package which provides APIs for managing applications -run as daemons. Its principal use to date has been to manage the application -server and storage server daemons for Zope / ZEO, although it is not limited -to running Python-based applications (for instance, it has been used to -manage the 'spread' daemon). +``zdaemon`` is a Unix (Unix, Linux, Mac OS X) Python program that wraps +commands to make them behave as proper daemons. .. contents:: Modified: zdaemon/trunk/setup.py === --- zdaemon/trunk/setup.py 2012-06-07 20:34:56 UTC (rev 126680) +++ zdaemon/trunk/setup.py 2012-06-07 20:52:43 UTC (rev 126681) @@ -30,7 +30,7 @@ include_package_data = True, install_requires=["ZConfig"], extras_require=dict( -test=['zope.testing', 'manuel', 'zc.customdoctests']), +test=['zope.testing', 'manuel', 'zc.customdoctests', 'mock']), ) except ImportError: from distutils.core import setup Copied: zdaemon/trunk/src/zdaemon/tests/testuser.py (from rev 126680, zdaemon/branches/2/src/zdaemon/tests/testuser.py) === --- zdaemon/trunk/src/zdaemon/tests/testuser.py (rev 0) +++ zdaemon/trunk/src/zdaemon/tests/testuser.py 2012-06-07 20:52:43 UTC (rev 126681) @@ -0,0 +1,111 @@ +## +# +# Copyright (c) 2010 Zope Foundation and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +## + +# Test user and groups options + +from zope.testing import setupstack +import doctest +import mock +import os +import sys +import unittest +import zdaemon.zdctl + +def write(name, text): +with open(name, 'w') as f: +f.write(text) + +class O: +def __init__(self, **kw): +self.__dict__.update(kw) + +def test_user_fails_when_not_root(): +""" + +>>> write('conf', +... ''' +... +... program sleep 9 +... user zope +... +... ''') + +>>> with mock.patch('os.geteuid') as geteuid: +... with mock.patch('sys.stderr'): +... sys.stderr = sys.stdout +... geteuid.return_value = 42 +... try: +... zdaemon.zdctl.main(['-C', 'conf', 'status']) +... except SystemExit: +... pass +... else: +... print 'oops' +... # doctest: +ELLIPSIS +Error: only root can use -u USER to change users +For help, use ... -h + +>>> import pwd +>>> pwd.getpwnam.assert_called_with('zope') + +""" + +def test_user_sets_supplemtary_groups(): +""" + +>>> write('conf', +... ''' +... +... program sleep 9 +... user zope +... +... ''') + +>>> import grp +>>> grp.getgrall.return_value = [ +... O(gr_gid=8, gr_mem =['g', 'zope', ]), +... O(gr_gid=1, gr_mem =['a', 'x', ]), +... O(gr_gid=2, gr_mem =['b', 'x', 'zope']), +... O(gr_gid=5, gr_mem =['c', 'x', ]), +
[Zope-Checkins] SVN: zdaemon/trunk/ Fixed change log format, made table of contents nicer.
Log message for revision 99304: Fixed change log format, made table of contents nicer. Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/setup.py U zdaemon/trunk/src/zdaemon/README.txt -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2009-04-20 06:26:13 UTC (rev 99303) +++ zdaemon/trunk/CHANGES.txt 2009-04-20 07:21:38 UTC (rev 99304) @@ -1,9 +1,17 @@ -zdaemon Changelog -* +=== + Changelog +=== -zdaemon 2.0.3 (2009/04/11) -== +2.0.4 (unreleased) +== + +- Fixed change log format, made table of contents nicer. + + +2.0.3 (2009-04-11) +== + - Added support to bootstrap on Jython. - If the run directory does not exist it will be created. This allow to use @@ -20,16 +28,16 @@ Help is now taken from the __doc__ of the options class users by the zdaemon script being run. -zdaemon 2.0.2 (2008/04/05) -== +2.0.2 (2008-04-05) +== Bugs Fixed -- Fixed backwards incompatible change in handling of environment option. -zdaemon 2.0.1 (2007/10/31) -== +2.0.1 (2007-10-31) +== Bugs Fixed -- @@ -37,21 +45,21 @@ Fixed test renormalizer that did not work in certain cases where the environment was complex. -zdaemon 2.0.0 (2007/07/19) -== +2.0.0 (2007-07-19) +== Final release for 2.0.0. -zdaemon 2.0a6 (2007/01/11) -== +2.0a6 (2007-01-11) +== Bugs Fixed -- - When the user option was used, it only affected running the daemon. -zdaemon 2.0a3, 2.0a4, 2.0a5 (2007/01/10) - +2.0a3, 2.0a4, 2.0a5 (2007-01-10) + Bugs Fixed -- @@ -62,8 +70,8 @@ - Added extra checks to deal with programs that extend zdaemon and copy the schema and thus don't see updates to the ZConfig schema. -zdaemon 2.0a2 (2007/01/10) -== +2.0a2 (2007-01-10) +== New Features @@ -74,8 +82,8 @@ - Added a command to rotate the transcript log. -zdaemon 2.0a1 (2006/12/21) -== +2.0a1 (2006-12-21) +== Bugs Fixed -- @@ -107,13 +115,13 @@ there. The old -d option is kept for backward compatibility, but is a no-op. -zdaemon 1.4a1 (2005/11/21) -== +1.4a1 (2005-11-21) +== Fixed a bug in the distribution setup file. -zdaemon 1.4a1 (2005/11/05) -== +1.4a1 (2005-11-05) +== First semi-formal release. @@ -123,16 +131,16 @@ - Made 'zdaemon.zdoptions' not fail for --help when __main__.__doc__ is None. -After zdaemon 1.1 -= +After 1.1 += - Updated test 'testRunIgnoresParentSignals': - + o Use 'mkdtemp' to create a temporary directory to hold the test socket rather than creating the test socket in the test directory. Hopefully this will be more robust. Sometimes the test directory has a path so long that the test socket can't be created. - + o Changed management of 'donothing.sh'. This script is now created by the test in the temporarary directory with the necessary permissions. This is to avoids possible mangling of permissions @@ -140,7 +148,7 @@ file in the source tree, which is a bonus. - Rearranged source tree to conform to more usual zpkg-based layout: - + o Python package lives under 'src'. o Dependencies added to 'src' as 'svn:externals'. @@ -150,8 +158,8 @@ - Made umask-based test failures due to running as root emit a more forceful warning. -zdaemon 1.1 (2005/06/09) - +1.1 (2005-06-09) + - SVN tag: svn://svn.zope.org/repos/main/zdaemon/tags/zdaemon-1.1 @@ -166,6 +174,6 @@ - working directory -Bugs +Bugs - help command Modified: zdaemon/trunk/setup.py === --- zdaemon/trunk/setup.py 2009-04-20 06:26:13 UTC (rev 99303) +++ zdaemon/trunk/setup.py 2009-04-20 07:21:38 UTC (rev 99304) @@ -49,13 +49,11 @@ + '\n' + read('CHANGES.txt') + '\n' + -'Detailed Documentation\n' -'**\n' -+ '\n' + read('src/zdaemon/README.txt') + '\n' + -'Download\n' -'**\n' +'\n' + +'Download\n' + +'\n' ), packages=["zdaemon", "zdaemon.tests"], Modified: zdaemon/trunk/src/zdaemon/README.txt === --- zdaemon/trunk/src/zdaemon/README.txt2009-04-20 06:26:13 UTC (rev 99303) +++ zdaemon/trunk/src/zdaemon/README.txt
[Zope-Checkins] SVN: zdaemon/trunk/ Fixed backwards incompatible change in handling of environment option. Using the environment option in Zope 2.11 was broken, as environment is a dict and not an obj
Log message for revision 85012: Fixed backwards incompatible change in handling of environment option. Using the environment option in Zope 2.11 was broken, as environment is a dict and not an object with a mapping attribute. Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/setup.py U zdaemon/trunk/src/zdaemon/zdctl.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2008-03-29 11:33:23 UTC (rev 85011) +++ zdaemon/trunk/CHANGES.txt 2008-03-29 18:43:54 UTC (rev 85012) @@ -1,6 +1,14 @@ zdaemon Changelog * +zdaemon 2.0.2 (unreleased) +== + +Bugs Fixed +-- + +Fixed backwards incompatible change in handling of environment option. + zdaemon 2.0.1 (2007/10/31) == Modified: zdaemon/trunk/setup.py === --- zdaemon/trunk/setup.py 2008-03-29 11:33:23 UTC (rev 85011) +++ zdaemon/trunk/setup.py 2008-03-29 18:43:54 UTC (rev 85012) @@ -37,7 +37,7 @@ name = "zdaemon" setup( name=name, -version="2.1.0", +version="2.0.2", url="http://www.python.org/pypi/zdaemon";, license="ZPL 2.1", description= Modified: zdaemon/trunk/src/zdaemon/zdctl.py === --- zdaemon/trunk/src/zdaemon/zdctl.py 2008-03-29 11:33:23 UTC (rev 85011) +++ zdaemon/trunk/src/zdaemon/zdctl.py 2008-03-29 18:43:54 UTC (rev 85012) @@ -134,12 +134,15 @@ print "our program =", program print "daemon's args =", args -if (options.configroot is not None -and -getattr(options.configroot, 'environment', None) is not None -): -for k, v in options.configroot.environment.mapping.items(): -os.environ[k] = v +if options.configroot is not None: +env = getattr(options.configroot, 'environment', None) +if env is not None: +if getattr(env, 'mapping', None) is not None: +for k, v in env.mapping.items(): +os.environ[k] = v +elif type(env) is type({}): +for k, v in env.items(): +os.environ[k] = v self.set_uid() ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/ Fixed test renormalizer that did not work in certain cases where the
Log message for revision 81261: Fixed test renormalizer that did not work in certain cases where the environment was complex. Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/setup.py U zdaemon/trunk/src/zdaemon/tests/tests.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2007-10-31 02:46:52 UTC (rev 81260) +++ zdaemon/trunk/CHANGES.txt 2007-10-31 04:24:44 UTC (rev 81261) @@ -1,6 +1,15 @@ zdaemon Changelog * +zdaemon 2.0.1 (2007/10/31) +== + +Bugs Fixed +-- + +Fixed test renormalizer that did not work in certain cases where the +environment was complex. + zdaemon 2.0.0 (2007/07/19) == Modified: zdaemon/trunk/setup.py === --- zdaemon/trunk/setup.py 2007-10-31 02:46:52 UTC (rev 81260) +++ zdaemon/trunk/setup.py 2007-10-31 04:24:44 UTC (rev 81261) @@ -68,5 +68,5 @@ 'Topic :: Utilities', 'Operating System :: POSIX', ], - + **setuptools_options) Modified: zdaemon/trunk/src/zdaemon/tests/tests.py === --- zdaemon/trunk/src/zdaemon/tests/tests.py2007-10-31 02:46:52 UTC (rev 81260) +++ zdaemon/trunk/src/zdaemon/tests/tests.py2007-10-31 04:24:44 UTC (rev 81261) @@ -134,7 +134,7 @@ setUp=setUp, tearDown=tearDown, checker=renormalizing.RENormalizing([ (re.compile('pid=\d+'), 'pid=NNN'), -(re.compile('^env\n((\w+=[^\n]*\n)+)$'), checkenv), +(re.compile('^env\n((?:.*\n)+)$'), checkenv), ]) ), )) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins