15625780 pkg contents: default value for -o should vary to match -t(followup)
authorMingrui Lyu <mingrui.lyu@oracle.com>
Fri, 19 Aug 2016 21:44:25 -0700
changeset 3410 7c7471728191
parent 3409 4e2be54095da
child 3411 0613a9e0ff31
15625780 pkg contents: default value for -o should vary to match -t(followup)
src/client.py
src/tests/cli/t_pkg_contents.py
--- a/src/client.py	Fri Aug 19 15:04:45 2016 -0700
+++ b/src/client.py	Fri Aug 19 21:44:25 2016 -0700
@@ -3301,10 +3301,17 @@
                         usage(_("-m and {0} may not be specified at the same "
                             "time").format(invalid.pop()), cmd=subcommand)
 
-        if action_types and all(
-            atype not in default_attrs
-            for atype in action_types):
-                usage(_("no valid action types specified"), cmd=subcommand)
+        if action_types:
+                invalid_atype = [atype
+                    for atype in action_types
+                    if atype not in default_attrs]
+                if invalid_atype == action_types:
+                        usage(_("no valid action types specified"),
+                            cmd=subcommand)
+                elif invalid_atype:
+                        msg(_("""\
+WARNING: invalid action types specified:{0}
+""".format(",".join(invalid_atype))))
 
         check_attrs(attrs, subcommand)
 
--- a/src/tests/cli/t_pkg_contents.py	Fri Aug 19 15:04:45 2016 -0700
+++ b/src/tests/cli/t_pkg_contents.py	Fri Aug 19 21:44:25 2016 -0700
@@ -114,7 +114,7 @@
                 self.assertTrue("LICENSE" in self.output and "NAME" in self.output
                     and "VALUE" in self.output)
                 self.pkg("contents -t falseaction", exit=2)
-                self.pkg("contents -t falseaction,file", exit=1)
+                self.pkg("contents -t falseaction,file", exit=0)
                 self.assertTrue("PATH" in self.output)
 
         def test_contents_empty_image(self):