Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 2/2] controller: fix compl for sec enabled immediately
Date: Thu, 21 Feb 2019 12:27:39 +0900	[thread overview]
Message-ID: <1550719659-14226-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1550719659-14226-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

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 <ogawa.yasufumi@lab.ntt.co.jp>
---
 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

      parent reply	other threads:[~2019-02-21  3:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21  3:27 [spp] [PATCH 0/2] Fix bugs of SPP CLI ogawa.yasufumi
2019-02-21  3:27 ` [spp] [PATCH 1/2] controller: fix bug terminated if no sec ID found ogawa.yasufumi
2019-02-21  3:27 ` ogawa.yasufumi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1550719659-14226-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
    --to=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=spp@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).