Return-Path: Received: from dan.rpsys.net (5751f4a1.skybroadband.com [87.81.244.161]) by mail.openembedded.org (Postfix) with ESMTP id 5F3C278431 for ; Thu, 31 Aug 2017 16:38:42 +0000 (UTC) Received: from hex ([192.168.3.34]) (authenticated bits=0) by dan.rpsys.net (8.15.2/8.15.2/Debian-3) with ESMTPSA id v7VGcfXC028721 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 31 Aug 2017 17:38:42 +0100 Received: from richard by hex with local (Exim 4.86_2) (envelope-from ) id 1dnSUL-0003FV-8B; Thu, 31 Aug 2017 17:38:41 +0100 From: Richard Purdie To: bitbake-devel@lists.openembedded.org Date: Thu, 31 Aug 2017 17:38:34 +0100 Message-Id: <1504197520-12428-4-git-send-email-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504197520-12428-1-git-send-email-richard.purdie@linuxfoundation.org> References: <1504197520-12428-1-git-send-email-richard.purdie@linuxfoundation.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (dan.rpsys.net [192.168.3.1]); Thu, 31 Aug 2017 17:38:42 +0100 (BST) X-Virus-Scanned: clamav-milter 0.99.2 at dan X-Virus-Status: Clean Subject: [PATCH 04/10] prserv/serv: Shut down any existing server before restarting X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussion that advance bitbake development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Aug 2017 16:38:46 -0000 This allows for cleaner code in cooker as any existing server is dealt with before a new one is started. Signed-off-by: Richard Purdie --- lib/prserv/serv.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/prserv/serv.py b/lib/prserv/serv.py index 306f0a3..a2da072 100644 --- a/lib/prserv/serv.py +++ b/lib/prserv/serv.py @@ -442,6 +442,9 @@ class PRServiceConfigError(Exception): def auto_start(d): global singleton + # Shutdown any existing PR Server + auto_shutdown() + host_params = list(filter(None, (d.getVar('PRSERV_HOST') or '').split(':'))) if not host_params: return None -- 2.7.4