From 73c88aeb16d45bdb6a391dc39b2b463819c8232e Mon Sep 17 00:00:00 2001 From: Andris Raugulis Date: Thu, 6 Sep 2018 17:09:40 +0300 Subject: [PATCH] Make openconnect_args optional also in code. --- gp-okta.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gp-okta.py b/gp-okta.py index f812460..e883a0a 100755 --- a/gp-okta.py +++ b/gp-okta.py @@ -348,7 +348,7 @@ def main(): cmd = conf.get('openconnect_cmd') or 'openconnect' cmd += ' --protocol=gp -u "{0}"' cmd += ' --usergroup portal:portal-userauthcookie' - cmd += ' --passwd-on-stdin ' + conf.get('openconnect_args') + ' "{1}"' + cmd += ' --passwd-on-stdin ' + conf.get('openconnect_args', '') + ' "{1}"' cmd = cmd.format(saml_username, conf.get('vpn_url')) gw = (conf.get('gateway') or '').strip() nlbug = '\\n' if conf.get('bug.nl', '').lower() in ['1', 'true'] else '' @@ -363,10 +363,8 @@ def main(): pp = subprocess.Popen(shlex.split(pcmd), stdout=subprocess.PIPE) cp = subprocess.Popen(cmd, stdin=pp.stdout, stdout=sys.stdout) pp.stdout.close() - - # Do not abort on SIGINT. openconnect will see it, and perform proper exit & cleanup + # Do not abort on SIGINT. openconnect will perform proper exit & cleanup signal.signal(signal.SIGINT, signal.SIG_IGN) - cp.communicate() else: print('{0} | {1}'.format(pcmd, cmd))