dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/42188?usp=email )


Change subject: contrib/smpp-ota-tool: fix boolean commandline parameters
......................................................................

contrib/smpp-ota-tool: fix boolean commandline parameters

Boolean parameters should be false by default and use store_true when
set.

Change-Id: I0652b48d2ea5efbaaf5bc147aa8cef7ab8b0861d
Related: OS#6868
---
M contrib/smpp-ota-tool.py
1 file changed, 5 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/88/42188/1

diff --git a/contrib/smpp-ota-tool.py b/contrib/smpp-ota-tool.py
index be08724..3958d38 100755
--- a/contrib/smpp-ota-tool.py
+++ b/contrib/smpp-ota-tool.py
@@ -194,12 +194,12 @@
     option_parser.add_argument('--tar', required=True, type=is_hexstr, 
help='Toolkit Application Reference')
     option_parser.add_argument("--cntr_req", 
choices=CNTR_REQ.decmapping.values(), default='no_counter',
                                help="Counter requirement")
-    option_parser.add_argument('--ciphering', default=True, type=bool, 
help='Enable ciphering')
+    option_parser.add_argument('--no-ciphering', action='store_true', 
default=False, help='Disable ciphering')
     option_parser.add_argument("--rc-cc-ds", 
choices=RC_CC_DS.decmapping.values(), default='cc',
                                help="message check (rc=redundency check, 
cc=crypt. checksum, ds=digital signature)")
-    option_parser.add_argument('--por-in-submit', default=False, type=bool,
+    option_parser.add_argument('--por-in-submit', action='store_true', 
default=False,
                                help='require PoR to be sent via SMS-SUBMIT')
-    option_parser.add_argument('--por-shall-be-ciphered', default=True, 
type=bool, help='require encrypted PoR')
+    option_parser.add_argument('--por-no-ciphering', action='store_true', 
default=False, help='Disable ciphering (PoR)')
     option_parser.add_argument("--por-rc-cc-ds", 
choices=RC_CC_DS.decmapping.values(), default='cc',
                                help="PoR check (rc=redundency check, cc=crypt. 
checksum, ds=digital signature)")
     option_parser.add_argument("--por_req", 
choices=POR_REQ.decmapping.values(), default='por_required',
@@ -226,10 +226,10 @@
                            kid=h2b(opts.kid),
                            cntr=opts.cntr)
     spi = {'counter' : opts.cntr_req,
-           'ciphering' : opts.ciphering,
+           'ciphering' : not opts.no_ciphering,
            'rc_cc_ds': opts.rc_cc_ds,
-           'por_shall_be_ciphered':opts.por_shall_be_ciphered,
            'por_in_submit': opts.por_in_submit,
+           'por_shall_be_ciphered': not opts.por_no_ciphering,
            'por_rc_cc_ds': opts.por_rc_cc_ds,
            'por': opts.por_req}
     apdu = h2b("".join(opts.apdu))

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/42188?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I0652b48d2ea5efbaaf5bc147aa8cef7ab8b0861d
Gerrit-Change-Number: 42188
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>

Reply via email to