@@ -48,7 +48,8 @@ def RepWarning(msg):
4848parser .add_argument ("--max-versions-per-project" , dest = 'max_versions_per_project' , type = int , help = "Maximum versions per project to inspect else all" )
4949parser .add_argument ("--max-components" , dest = 'max_components' , type = int , help = "Maximum components to inspect in total else all" )
5050
51- parser .add_argument ("--debug" , dest = 'debug' , type = int , default = 0 , help = "Debug verbosity (0=none)" )
51+ parser .add_argument ("--debug" , dest = 'debug' , type = int , default = 0 , help = "Debug verbosity (0=none 'n'=level)" )
52+ parser .add_argument ("--dryrun" , dest = 'dry_run' , type = int , default = 0 , help = "Dry run test (0=no 1=yes)" )
5253
5354parser .add_argument ("--no-verify" , dest = 'verify' , action = 'store_false' , help = "Disable TLS certificate verification" )
5455parser .add_argument ("-t" , "--timeout" , default = 15 , type = int , help = "Adjust the (HTTP) session timeout value (default: 15s)" )
@@ -228,13 +229,17 @@ def RepWarning(msg):
228229 # refresh end point
229230 url += "/copyrights-refresh"
230231
231- try :
232- response = bd .session .put (url , data = None , ** refresh_kwargs )
233- RepDebug (5 ,'Refresh response %s' % response )
234- except urllib3 .exceptions .ReadTimeoutError :
235- print ('Failed to confirm copyrights refresh' )
232+ if args .dry_run != 0 :
233+ RepDebug (1 , "DryRun: %s" % url )
234+ else :
235+ try :
236+ response = bd .session .put (url , data = None , ** refresh_kwargs )
237+ RepDebug (5 ,'Refresh response %s' % response )
238+ except ReadTimeoutError :
239+ print ('Failed to confirm copyrights refresh' )
240+
241+ my_statistics ['_cntRefresh' ] += 1
236242
237- my_statistics ['_cntRefresh' ] += 1
238243 else :
239244 my_statistics ['_cntNoOrigins' ] += 1
240245 url = 'n/a'
0 commit comments