@@ -216,22 +216,26 @@ def setMultipleTarget():
216
216
if not conf .urlFile :
217
217
for pocname , pocInstance in kb .registeredPocs .items ():
218
218
target_urls = []
219
- if conf .url .endswith ('/24' ):
220
- try :
221
- socket .inet_aton (conf .url .split ('/' )[0 ])
222
- base_addr = conf .url [:conf .url .rfind ('.' ) + 1 ]
223
- target_urls = ['{}{}' .format (base_addr , i )
224
- for i in xrange (1 , 255 + 1 )]
225
- except socket .error :
226
- errMsg = 'only id address acceptable'
227
- logger .log (CUSTOM_LOGGING .ERROR , errMsg )
219
+ if conf .url :
220
+ if conf .url .endswith ('/24' ):
221
+ try :
222
+ socket .inet_aton (conf .url .split ('/' )[0 ])
223
+ base_addr = conf .url [:conf .url .rfind ('.' ) + 1 ]
224
+ target_urls = ['{}{}' .format (base_addr , i )
225
+ for i in xrange (1 , 255 + 1 )]
226
+ except socket .error :
227
+ errMsg = 'only id address acceptable'
228
+ logger .log (CUSTOM_LOGGING .ERROR , errMsg )
229
+ else :
230
+ target_urls = conf .url .split (',' )
231
+
232
+ for url in target_urls :
233
+ if url :
234
+ kb .targets .put ((url , pocInstance , pocname ))
228
235
else :
229
- target_urls = conf .url .split (',' )
230
-
231
- for url in target_urls :
232
- if url :
233
- kb .targets .put ((url , pocInstance , pocname ))
234
-
236
+ errMsg = 'the url needs to be set'
237
+ logger .log (CUSTOM_LOGGING .ERROR , errMsg )
238
+ break
235
239
return
236
240
237
241
conf .urlFile = safeExpandUser (conf .urlFile )
0 commit comments