From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mogw0922.ocn.ad.jp (mogw0922.ocn.ad.jp [153.149.227.28]) by dpdk.org (Postfix) with ESMTP id 176171B320 for ; Tue, 3 Oct 2017 12:42:36 +0200 (CEST) Received: from mf-smf-ucb011.ocn.ad.jp (mf-smf-ucb011.ocn.ad.jp [153.149.228.228]) by mogw0922.ocn.ad.jp (Postfix) with ESMTP id D51E428002A; Tue, 3 Oct 2017 19:42:34 +0900 (JST) Received: from mf-smf-ucb011.ocn.ad.jp (mf-smf-ucb011 [153.149.228.228]) by mf-smf-ucb011.ocn.ad.jp (Postfix) with ESMTP id BB5F290022E; Tue, 3 Oct 2017 19:42:34 +0900 (JST) Received: from ntt.pod01.mv-mta-ucb025 (mv-mta-ucb025.ocn.ad.jp [153.149.142.99]) by mf-smf-ucb011.ocn.ad.jp (Switch-3.3.4/Switch-3.3.4) with ESMTP id v93Ag4PS046379; Tue, 3 Oct 2017 19:42:34 +0900 Received: from smtp.ocn.ne.jp ([153.149.227.166]) by ntt.pod01.mv-mta-ucb025 with id GyiY1w0053c2f7501yiYku; Tue, 03 Oct 2017 10:42:34 +0000 Received: from localhost.localdomain (sp1-75-231-175.msb.spmode.ne.jp [1.75.231.175]) by smtp.ocn.ne.jp (Postfix) with ESMTPA; Tue, 3 Oct 2017 19:42:28 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org Cc: gerald.rogers@intel.com, sy.jong.choi@intel.com, Yasufumi Ogawa Date: Tue, 3 Oct 2017 19:42:12 +0900 Message-Id: <20171003104214.81003-1-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.13.1 Subject: [spp] [PATCH 1/3] spp: fix bug of precmd X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2017 10:42:37 -0000 From: Yasufumi Ogawa In precmd function, command log is not recorded if it is 'playback' to avoid illegal action when the log is loaded. However, 'bye' should be also excluded from the log because spp.py is terminated immediately if the log is loaded. This change for adding a condition for command logging. Signed-off-by: Yasufumi Ogawa --- src/spp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/spp.py b/src/spp.py index 68b3a3f..4aa0c62 100755 --- a/src/spp.py +++ b/src/spp.py @@ -503,8 +503,9 @@ class Shell(cmd.Cmd): def precmd(self, line): line = line.lower() - if self.recorded_file and 'playback' not in line: - print(line, file=self.recorded_file) + if self.recorded_file: + if not (('playback' in line) or ('bye' in line)): + print(line, file=self.recorded_file) return line def close(self): -- 2.13.1