enable global arguament '-d' '-i' '-v' to mic create subcommands 77/296177/3
authorbiao716.wang <biao716.wang@samsung.com>
Fri, 21 Jul 2023 06:53:38 +0000 (15:53 +0900)
committerbiao716.wang <biao716.wang@samsung.com>
Tue, 25 Jul 2023 08:47:33 +0000 (17:47 +0900)
Change-Id: Ife1550c3740a62b15b39fbea3b5cd79c010153ab
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
tools/mic

index 6cfcd49..e5e1e6d 100755 (executable)
--- a/tools/mic
+++ b/tools/mic
@@ -271,6 +271,20 @@ def main(argv):
 
     # Parse arguments
     args = parser.parse_args(argv[1:])
+    #In python3.x version, if global opiton '-d' , '-v', '-i' is used, it will be not passed to mic create command.
+    #beside, there is same arguments in mic create command.
+    for debug_option in ('-d', '--debug'):
+        if debug_option in argv[1:]:
+            args.debug = True
+
+    for verbose_option in ('-v', '--verbose'):
+        if verbose_option in argv[1:]:
+            args.verbose = True
+    #for python3.x, args.interactive will always be True even using --non-interactive, that's because it is rewirte by option '-i'
+    #for '-i', use it, action is True, without it, default value is True.
+    if '--non-interactive' in argv[1:]:
+        args.interactive = False
+
 
     if args.interactive:
         msger.enable_interactive()
@@ -283,7 +297,7 @@ def main(argv):
     if args.debug:
         try:
             import rpm
-            rpm.setVerbosity(rpm.RPMLOG_DEBUG)
+            rpm.setVerbosity(rpm.RPMLOG_NOTICE)
         except ImportError:
             pass