Hello community, here is the log from the commit of package python-oslo.rootwrap for openSUSE:Factory checked in at 2017-06-08 15:03:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-oslo.rootwrap (Old) and /work/SRC/openSUSE:Factory/.python-oslo.rootwrap.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-oslo.rootwrap" Thu Jun 8 15:03:10 2017 rev:4 rq:501642 version:5.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-oslo.rootwrap/python-oslo.rootwrap.changes 2017-02-21 13:42:16.616618511 +0100 +++ /work/SRC/openSUSE:Factory/.python-oslo.rootwrap.new/python-oslo.rootwrap.changes 2017-06-08 15:03:11.409439584 +0200 @@ -1,0 +2,10 @@ +Wed Jun 7 09:51:00 UTC 2017 - cloud-de...@suse.de + +- update to version 5.4.1 + - Avoid importing Linux specific modules on Windows + - Update UPPER_CONSTRAINTS_FILE for stable/ocata + - Allow rootwrap-daemon to timeout and exit + - [daemon] Close inherited filedescriptors after forking + - Update .gitreview for stable/ocata + +------------------------------------------------------------------- Old: ---- oslo.rootwrap-5.4.0.tar.gz New: ---- oslo.rootwrap-5.4.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-oslo.rootwrap.spec ++++++ --- /var/tmp/diff_new_pack.FW14NH/_old 2017-06-08 15:03:12.029352097 +0200 +++ /var/tmp/diff_new_pack.FW14NH/_new 2017-06-08 15:03:12.029352097 +0200 @@ -18,7 +18,7 @@ %global sname oslo.rootwrap Name: python-oslo.rootwrap -Version: 5.4.0 +Version: 5.4.1 Release: 0 Summary: Filtering shell commands to run as root from OpenStack services License: Apache-2.0 ++++++ oslo.rootwrap-5.4.0.tar.gz -> oslo.rootwrap-5.4.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.rootwrap-5.4.0/AUTHORS new/oslo.rootwrap-5.4.1/AUTHORS --- old/oslo.rootwrap-5.4.0/AUTHORS 2017-01-18 20:32:57.000000000 +0100 +++ new/oslo.rootwrap-5.4.1/AUTHORS 2017-05-22 19:07:39.000000000 +0200 @@ -4,6 +4,7 @@ Cedric Brandily <zze...@gmail.com> ChangBo Guo(gcb) <eric....@easystack.cn> Christian Berendt <bere...@b1-systems.de> +Claudiu Belu <cb...@cloudbasesolutions.com> Cyril Roelandt <cyril.roela...@enovance.com> Davanum Srinivas <dava...@gmail.com> Davanum Srinivas <d...@linux.vnet.ibm.com> @@ -12,6 +13,7 @@ Doug Hellmann <doug.hellm...@dreamhost.com> Doug Hellmann <d...@doughellmann.com> Flavio Percoco <flape...@gmail.com> +IWAMOTO Toshihiro <iwam...@valinux.co.jp> Ihar Hrachyshka <ihrac...@redhat.com> Jakub Libosvar <libos...@redhat.com> James Carey <jeca...@us.ibm.com> @@ -22,7 +24,9 @@ Mark McLoughlin <mar...@redhat.com> Maru Newby <ma...@redhat.com> Monty Taylor <mord...@inaugust.com> +OpenStack Release Bot <infra-r...@openstack.org> Pádraig Brady <p...@draigbrady.com> +Ralf Haferkamp <rha...@suse.de> Roman Podolyaka <rpodoly...@mirantis.com> Ronald Bradford <ronald.bradf...@gmail.com> Sean Dague <s...@dague.net> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.rootwrap-5.4.0/ChangeLog new/oslo.rootwrap-5.4.1/ChangeLog --- old/oslo.rootwrap-5.4.0/ChangeLog 2017-01-18 20:32:57.000000000 +0100 +++ new/oslo.rootwrap-5.4.1/ChangeLog 2017-05-22 19:07:39.000000000 +0200 @@ -1,6 +1,15 @@ CHANGES ======= +5.4.1 +----- + +* Allow rootwrap-daemon to timeout and exit +* Avoid importing Linux specific modules on Windows +* [daemon] Close inherited filedescriptors after forking +* Update UPPER_CONSTRAINTS_FILE for stable/ocata +* Update .gitreview for stable/ocata + 5.4.0 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.rootwrap-5.4.0/PKG-INFO new/oslo.rootwrap-5.4.1/PKG-INFO --- old/oslo.rootwrap-5.4.0/PKG-INFO 2017-01-18 20:32:58.000000000 +0100 +++ new/oslo.rootwrap-5.4.1/PKG-INFO 2017-05-22 19:07:39.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: oslo.rootwrap -Version: 5.4.0 +Version: 5.4.1 Summary: Oslo Rootwrap Home-page: http://docs.openstack.org/developer/oslo.rootwrap Author: OpenStack diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.rootwrap-5.4.0/etc/rootwrap.conf.sample new/oslo.rootwrap-5.4.1/etc/rootwrap.conf.sample --- old/oslo.rootwrap-5.4.0/etc/rootwrap.conf.sample 2017-01-18 20:31:15.000000000 +0100 +++ new/oslo.rootwrap-5.4.1/etc/rootwrap.conf.sample 2017-05-22 19:05:28.000000000 +0200 @@ -25,3 +25,6 @@ # INFO means log all usage # ERROR means only log unsuccessful attempts syslog_log_level=ERROR + +# Rootwrap daemon exits after this seconds of inactivity +daemon_timeout=600 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.rootwrap-5.4.0/oslo.rootwrap.egg-info/PKG-INFO new/oslo.rootwrap-5.4.1/oslo.rootwrap.egg-info/PKG-INFO --- old/oslo.rootwrap-5.4.0/oslo.rootwrap.egg-info/PKG-INFO 2017-01-18 20:32:57.000000000 +0100 +++ new/oslo.rootwrap-5.4.1/oslo.rootwrap.egg-info/PKG-INFO 2017-05-22 19:07:39.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: oslo.rootwrap -Version: 5.4.0 +Version: 5.4.1 Summary: Oslo Rootwrap Home-page: http://docs.openstack.org/developer/oslo.rootwrap Author: OpenStack diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.rootwrap-5.4.0/oslo.rootwrap.egg-info/pbr.json new/oslo.rootwrap-5.4.1/oslo.rootwrap.egg-info/pbr.json --- old/oslo.rootwrap-5.4.0/oslo.rootwrap.egg-info/pbr.json 2017-01-18 20:32:57.000000000 +0100 +++ new/oslo.rootwrap-5.4.1/oslo.rootwrap.egg-info/pbr.json 2017-05-22 19:07:39.000000000 +0200 @@ -1 +1 @@ -{"is_release": true, "git_version": "698ce0b"} \ No newline at end of file +{"git_version": "fdacd0e", "is_release": true} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.rootwrap-5.4.0/oslo_rootwrap/client.py new/oslo.rootwrap-5.4.1/oslo_rootwrap/client.py --- old/oslo.rootwrap-5.4.0/oslo_rootwrap/client.py 2017-01-18 20:31:15.000000000 +0100 +++ new/oslo.rootwrap-5.4.1/oslo_rootwrap/client.py 2017-05-22 19:05:28.000000000 +0200 @@ -62,7 +62,8 @@ process_obj = subprocess.Popen(self._start_command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + stderr=subprocess.PIPE, + close_fds=True) LOG.debug("Popen for %s command has been instantiated", self._start_command) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.rootwrap-5.4.0/oslo_rootwrap/daemon.py new/oslo.rootwrap-5.4.1/oslo_rootwrap/daemon.py --- old/oslo.rootwrap-5.4.0/oslo_rootwrap/daemon.py 2017-01-18 20:31:15.000000000 +0100 +++ new/oslo.rootwrap-5.4.1/oslo_rootwrap/daemon.py 2017-05-22 19:05:28.000000000 +0200 @@ -26,6 +26,7 @@ import sys import tempfile import threading +import time from oslo_rootwrap import cmd from oslo_rootwrap import jsonrpc @@ -44,8 +45,11 @@ def __init__(self, config, filters): self.config = config self.filters = filters + self.reset_timer() + self.prepare_timer(config) def run_one_command(self, userargs, stdin=None): + self.reset_timer() try: obj = wrapper.start_subprocess( self.filters, userargs, @@ -73,7 +77,40 @@ err = os.fsdecode(err) return obj.returncode, out, err - def shutdown(self): + @classmethod + def reset_timer(cls): + cls.last_called = time.time() + + @classmethod + def cancel_timer(cls): + try: + cls.timeout.cancel() + except RuntimeError: + pass + + @classmethod + def prepare_timer(cls, config=None): + if config is not None: + cls.daemon_timeout = config.daemon_timeout + # Wait a bit longer to avoid rounding errors + timeout = max( + cls.last_called + cls.daemon_timeout - time.time(), + 0) + 1 + if getattr(cls, 'timeout', None): + # Another timer is already initialized + return + cls.timeout = threading.Timer(timeout, cls.handle_timeout) + cls.timeout.start() + + @classmethod + def handle_timeout(cls): + if cls.last_called < time.time() - cls.daemon_timeout: + cls.shutdown() + + cls.prepare_timer() + + @staticmethod + def shutdown(): # Suicide to force break of the main thread os.kill(os.getpid(), signal.SIGINT) @@ -144,6 +181,7 @@ except Exception: # Most likely the socket have already been closed LOG.debug("Failed to close connection") + RootwrapClass.cancel_timer() LOG.info("Waiting for all client threads to finish.") for thread in threading.enumerate(): if thread.daemon: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.rootwrap-5.4.0/oslo_rootwrap/filters.py new/oslo.rootwrap-5.4.1/oslo_rootwrap/filters.py --- old/oslo.rootwrap-5.4.0/oslo_rootwrap/filters.py 2017-01-18 20:31:15.000000000 +0100 +++ new/oslo.rootwrap-5.4.1/oslo_rootwrap/filters.py 2017-05-22 19:05:29.000000000 +0200 @@ -14,9 +14,14 @@ # under the License. import os -import pwd import re import shutil +import sys + +if sys.platform != 'win32': + # NOTE(claudiub): pwd is a Linux-specific library, and currently there is + # no Windows support for oslo.rootwrap. + import pwd def _getuid(user): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.rootwrap-5.4.0/oslo_rootwrap/tests/test_functional.py new/oslo.rootwrap-5.4.1/oslo_rootwrap/tests/test_functional.py --- old/oslo.rootwrap-5.4.0/oslo_rootwrap/tests/test_functional.py 2017-01-18 20:31:15.000000000 +0100 +++ new/oslo.rootwrap-5.4.1/oslo_rootwrap/tests/test_functional.py 2017-05-22 19:05:29.000000000 +0200 @@ -21,6 +21,7 @@ import signal import sys import threading +import time try: import eventlet @@ -50,6 +51,7 @@ with open(self.config_file, 'w') as f: f.write("""[DEFAULT] filters_path=%s +daemon_timeout=10 exec_dirs=/bin""" % (filters_dir,)) with open(filters_file, 'w') as f: f.write("""[Filters] @@ -200,6 +202,15 @@ # Expect client to successfully restart daemon and run simple request self.test_run_once() + def test_daemon_timeout(self): + # Let the client start a daemon + self.execute(['echo']) + # Make daemon timeout + with mock.patch.object(self.client, '_restart') as restart: + time.sleep(15) + self.execute(['echo']) + restart.assert_called_once() + def _exec_thread(self, fifo_path): try: # Run a shell script that signals calling process through FIFO and diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.rootwrap-5.4.0/oslo_rootwrap/wrapper.py new/oslo.rootwrap-5.4.1/oslo_rootwrap/wrapper.py --- old/oslo.rootwrap-5.4.0/oslo_rootwrap/wrapper.py 2017-01-18 20:31:15.000000000 +0100 +++ new/oslo.rootwrap-5.4.1/oslo_rootwrap/wrapper.py 2017-05-22 19:05:29.000000000 +0200 @@ -16,8 +16,11 @@ import logging import logging.handlers import os -import pwd import signal +import sys + +if sys.platform != 'win32': + import pwd import six from six import moves @@ -88,6 +91,12 @@ else: self.use_syslog = False + # daemon_timeout + if config.has_option("DEFAULT", "daemon_timeout"): + self.daemon_timeout = int(config.get("DEFAULT", "daemon_timeout")) + else: + self.daemon_timeout = 600 + def setup_syslog(execname, facility, level): rootwrap_logger = logging.getLogger() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.rootwrap-5.4.0/tox.ini new/oslo.rootwrap-5.4.1/tox.ini --- old/oslo.rootwrap-5.4.0/tox.ini 2017-01-18 20:31:15.000000000 +0100 +++ new/oslo.rootwrap-5.4.1/tox.ini 2017-05-22 19:05:29.000000000 +0200 @@ -7,7 +7,7 @@ VIRTUAL_ENV={envdir} BRANCH_NAME=master CLIENT_NAME=oslo.rootwrap -install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} +install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata} {opts} {packages} deps = -r{toxinidir}/test-requirements.txt # Functional tests with Eventlet involve monkeypatching, so force them to be # run in a separate process