File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ rm -rf $RPM_BUILD_ROOT
8181
8282%changelog
8383# - Fix htdecodetoken to work with token files that do not end in a newline.
84+ # - Support args in htgettoken.main() Python entry point.
8485
8586* Thu Jul 25 2024 Dave Dykstra <dwd@fnal.gov> 2.0-2
8687- Fix broken httokendecode symlink.
Original file line number Diff line number Diff line change @@ -499,7 +499,7 @@ def ttl2secs(ttl, msg):
499499
500500
501501### htgettoken main ####
502- def main ():
502+ def main (args = None ):
503503 global options
504504 usagestr = "usage: %prog [-h] [otheroptions]"
505505 parser = OptionParser (usage = usagestr , version = version , prog = prog )
@@ -630,8 +630,10 @@ def main():
630630 # look for default options in the environment
631631 envopts = os .getenv ("HTGETTOKENOPTS" , "" )
632632 envargs = shlex .split (envopts , True )
633+ if args is None :
634+ args = sys .argv [1 :]
633635
634- parseargs (parser , envargs + sys . argv [ 1 :] )
636+ parseargs (parser , envargs + list ( args ) )
635637
636638 if options .optserver is not None :
637639 # read additional options from optserver
You can’t perform that action at this time.
0 commit comments