File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -912,7 +912,7 @@ def main():
912912
913913 credkey = options .credkey
914914 configfile = None
915- if credkey is None :
915+ if credkey is None and ( not options . nobearertoken or options . showbearerurl ) :
916916 # Look for saved credkey, needed for figuring out the vault secretpath
917917 configfile = options .configdir + '/credkey-' + options .issuer + '-' + options .role
918918 configfile = os .path .expanduser (configfile )
@@ -933,7 +933,12 @@ def main():
933933 log ("Credkey from %s: %s" % (configfile , credkey ))
934934
935935 if (credkey is not None or options .nobearertoken ) and not options .registerssh :
936- fullsecretpath = secretpath .replace ("%credkey" , credkey )
936+ fullsecretpath = ""
937+ if credkey is None :
938+ if options .showbearerurl :
939+ fatal ("cannot do --showbearerurl because credkey is not known" )
940+ else :
941+ fullsecretpath = secretpath .replace ("%credkey" , credkey )
937942
938943 # Check to see if a valid vault token already exists and works by
939944 # attempting to read a bearer token
Original file line number Diff line number Diff line change @@ -124,6 +124,9 @@ rm -rf $RPM_BUILD_ROOT
124124
125125
126126%changelog
127+ # - Fix crash introduced in 1.17 when using --nobearertoken while the
128+ # credkey is not known.
129+
127130* Wed Mar 15 2023 Dave Dykstra <dwd@fnal.gov> 1.17-1
128131- Fix the usage of getaddrinfo, which caused a fatal error on python3.9
129132 on Mac.
You can’t perform that action at this time.
0 commit comments