File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 55import os
66import re
77import ssl
8- import sys
98import time
10- import urllib .parse
119import uuid
1210
1311# Configuration
3432num_submitted = 0
3533num_processed = 0
3634
35+ # URL to use for submission
36+ api_endpoint = ""
37+
38+ # Original args
39+ args = {}
3740
3841# Functions
3942def process_dir (workdir ):
@@ -155,6 +158,7 @@ def submit_sample(filepath):
155158 time .sleep (2 << retries )
156159 continue
157160
161+ # pylint: disable=no-else-continue
158162 if resp .status == 503 : # Service unavailable
159163 retry_time = resp .headers .get ("Retry-After" , 30 )
160164 time .sleep (retry_time )
@@ -204,13 +208,11 @@ def submit_sample(filepath):
204208 )
205209 parser .add_argument ("--debug" , action = "store_true" , help = "Enable debug logging." )
206210
207- global args
208211 args = parser .parse_args ()
209212
210213 if args .tls :
211214 schema = "https"
212215
213- global api_endpoint
214216 api_endpoint = "{}://{}:{}/api/checkAsync" .format (schema , args .server , args .port )
215217
216218 print ("=" * 80 )
@@ -230,8 +232,8 @@ def submit_sample(filepath):
230232 print ("Starting the walk at: {} ..." .format (", " .join (args .dirs )))
231233
232234 # Walk directory
233- for dir in args .dirs :
234- process_dir (dir )
235+ for walkdir in args .dirs :
236+ process_dir (walkdir )
235237
236238 # End message
237239 end_date = time .time ()
You can’t perform that action at this time.
0 commit comments