Patchwork python-smartpm: fix option typo of command channel

login
register
mail settings
Submitter Kang Kai
Date July 30, 2014, 6:26 a.m.
Message ID <1406701587-23581-1-git-send-email-kai.kang@windriver.com>
Download mbox | patch
Permalink /patch/76903/
State Accepted
Commit 3d1c6702534f1395b22775a4ff01a8152917dd04
Headers show

Comments

Kang Kai - July 30, 2014, 6:26 a.m.
When run smart, it fails:

root@qemu1:~# smart channel --remove-all
error: No action specified for command 'channel'

If no default value of arg 'dest' is provided in method add_option() of
optparse.OptionParser, it replaces hyphen('-') in new added option with
underscore('_') as dest.

In function ensure_action() it checks action strings with options from
optparse.OptionParser. So it is 'remove_all' which need to be checked
rather than 'remove-all'.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 .../python/python-smartpm/smart-improve-error-reporting.patch           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch b/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
index fece5b9..2ca0f6d 100644
--- a/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
+++ b/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
@@ -24,7 +24,7 @@  index aa76f91..63fbb35 100644
 +    opts.check_args_of_option("edit", 0)
 +    opts.check_args_of_option("enable", -1)
 +    opts.check_args_of_option("disable", -1)
-+    opts.ensure_action("channel", ["add", "set", "remove", "remove-all",
++    opts.ensure_action("channel", ["add", "set", "remove", "remove_all",
 +                       "list", "show", "yaml", "enable", "disable"])
 +    opts.check_remaining_args()
 +