From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tama50.ecl.ntt.co.jp (tama50.ecl.ntt.co.jp [129.60.39.147]) by dpdk.org (Postfix) with ESMTP id A8201292D for ; Thu, 21 Feb 2019 04:29:58 +0100 (CET) Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x1L3TvjG024337; Thu, 21 Feb 2019 12:29:57 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 3FD55EA7A8D; Thu, 21 Feb 2019 12:29:57 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 32CBFEA7957; Thu, 21 Feb 2019 12:29:57 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Thu, 21 Feb 2019 12:27:39 +0900 Message-Id: <1550719659-14226-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550719659-14226-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <1550719659-14226-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 2/2] controller: fix compl for sec enabled immediately 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: Thu, 21 Feb 2019 03:29:59 -0000 From: Yasufumi Ogawa SPP CLI does not complete for sec IDs until secondary list is updated. This list is updated while running some of commands, such as `status`. However, this behaviour might confuse user because user cannot find secondary after launched and doubt it is failed to. This update is to do completion everytime pressing TAB to update the list immediately. Signed-off-by: Yasufumi Ogawa --- src/controller/shell.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/controller/shell.py b/src/controller/shell.py index 2568523..e3f1ff8 100644 --- a/src/controller/shell.py +++ b/src/controller/shell.py @@ -362,7 +362,10 @@ class Shell(cmd.Cmd, object): print('Invalid command: %s' % tmparg) def complete_nfv(self, text, line, begidx, endidx): - """Completion for nfv command""" + """Completion for nfv command.""" + + if self.use_cache is False: + self.init_spp_procs() line = self.clean_cmd(line) @@ -463,7 +466,10 @@ class Shell(cmd.Cmd, object): print('Invalid command: %s' % tmparg) def complete_vf(self, text, line, begidx, endidx): - """Completion for vf command""" + """Completion for vf command.""" + + if self.use_cache is False: + self.init_spp_procs() line = self.clean_cmd(line) @@ -542,7 +548,10 @@ class Shell(cmd.Cmd, object): print('Invalid command: %s' % tmparg) def complete_mirror(self, text, line, begidx, endidx): - """Completion for mirror command""" + """Completion for mirror command.""" + + if self.use_cache is False: + self.init_spp_procs() line = self.clean_cmd(line) @@ -610,7 +619,10 @@ class Shell(cmd.Cmd, object): print('Invalid command: {}'.format(tmparg)) def complete_pcap(self, text, line, begidx, endidx): - """Completion for pcap command""" + """Completion for pcap command.""" + + if self.use_cache is False: + self.init_spp_procs() line = self.clean_cmd(line) -- 2.17.1