From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 11E8C13888F for ; Sat, 10 Oct 2015 20:20:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E4DFEE0833; Sat, 10 Oct 2015 20:20:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 80D39E0833 for ; Sat, 10 Oct 2015 20:20:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6C68934072E for ; Sat, 10 Oct 2015 20:20:20 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3905227A for ; Sat, 10 Oct 2015 20:20:18 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1444508762.ca4930493d12a8e2d8aa22ab70801f8569e88559.blueness@gentoo> Subject: [gentoo-commits] proj/grss:master commit in: grs/ X-VCS-Repository: proj/grss X-VCS-Files: grs/Execute.py grs/Interpret.py X-VCS-Directories: grs/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: ca4930493d12a8e2d8aa22ab70801f8569e88559 X-VCS-Branch: master Date: Sat, 10 Oct 2015 20:20:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 95c9b88d-b9c5-4dea-a9c5-3c60f980f8ba X-Archives-Hash: bed99a3398c3b7da006d42d6a2427a54 commit: ca4930493d12a8e2d8aa22ab70801f8569e88559 Author: Anthony G. Basile gentoo org> AuthorDate: Sat Oct 10 20:26:02 2015 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Sat Oct 10 20:26:02 2015 +0000 URL: https://gitweb.gentoo.org/proj/grss.git/commit/?id=ca493049 lint: minor code cleanups. grs/Execute.py | 3 +-- grs/Interpret.py | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/grs/Execute.py b/grs/Execute.py index 87667be..8d9da75 100644 --- a/grs/Execute.py +++ b/grs/Execute.py @@ -21,7 +21,6 @@ import signal import shlex import subprocess import sys -import time from grs.Constants import CONST class Execute(): @@ -71,7 +70,7 @@ class Execute(): if timed_out: _file.write('TIMEOUT ERROR: %s\n' % cmd) - if not failok and ( _rc != 0 or timed_out): + if not failok and (_rc != 0 or timed_out): pid = os.getpid() _file.write('SENDING SIGTERM: %s\n' % pid) _file.close() diff --git a/grs/Interpret.py b/grs/Interpret.py index 5624fd4..ab16cfa 100644 --- a/grs/Interpret.py +++ b/grs/Interpret.py @@ -20,7 +20,6 @@ import os import re import signal import sys -import time from grs.Constants import CONST from grs.Daemon import Daemon @@ -81,6 +80,9 @@ class Interpret(Daemon): if self.mock_run: _lo.log(_line) return + # We'll catch this exception to get in into the + # GRS system log rather than the daemon log. Without + # the try-except, it would wind up in the daemon log. try: func(*args) except Exception as excpt: @@ -89,10 +91,11 @@ class Interpret(Daemon): err = 'Number of parameters incorrect.' if err: + pid = os.getpid() _lo.log('Bad command: %s' % _line) _lo.log('Error message: %s' % err) - _lo.log('SENDING SIGTERM\n') - os.kill(os.getpid(), signal.SIGTERM) + _lo.log('SENDING SIGTERM to %d' % pid) + os.kill(pid, signal.SIGTERM) def stampit(progress):