@@ -48,7 +48,8 @@ def RepWarning(msg):
48
48
parser .add_argument ("--max-versions-per-project" , dest = 'max_versions_per_project' , type = int , help = "Maximum versions per project to inspect else all" )
49
49
parser .add_argument ("--max-components" , dest = 'max_components' , type = int , help = "Maximum components to inspect in total else all" )
50
50
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)" )
52
53
53
54
parser .add_argument ("--no-verify" , dest = 'verify' , action = 'store_false' , help = "Disable TLS certificate verification" )
54
55
parser .add_argument ("-t" , "--timeout" , default = 15 , type = int , help = "Adjust the (HTTP) session timeout value (default: 15s)" )
@@ -228,13 +229,17 @@ def RepWarning(msg):
228
229
# refresh end point
229
230
url += "/copyrights-refresh"
230
231
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
236
242
237
- my_statistics ['_cntRefresh' ] += 1
238
243
else :
239
244
my_statistics ['_cntNoOrigins' ] += 1
240
245
url = 'n/a'
0 commit comments