Remove subcasing for classes

This commit is contained in:
Daniel Goldberg 2018-08-29 10:20:02 -04:00
parent 3ce81ee78a
commit 83b1933296
1 changed files with 10 additions and 13 deletions

View File

@ -31,19 +31,16 @@ class Configuration(object):
continue
if self._depth_from_commandline and key == "depth":
continue
if 'class' in key:
# handle in cases
if key == 'finger_classes':
class_objects = [getattr(network_import, val) for val in value]
setattr(self, key, class_objects)
elif key == 'scanner_class':
scanner_object = getattr(network_import, value)
setattr(self, key, scanner_object)
elif key == 'exploiter_classes':
class_objects = [getattr(exploit_import, val) for val in value]
setattr(self, key, class_objects)
else:
unknown_items.append(key)
# handle in cases
if key == 'finger_classes':
class_objects = [getattr(network_import, val) for val in value]
setattr(self, key, class_objects)
elif key == 'scanner_class':
scanner_object = getattr(network_import, value)
setattr(self, key, scanner_object)
elif key == 'exploiter_classes':
class_objects = [getattr(exploit_import, val) for val in value]
setattr(self, key, class_objects)
else:
if hasattr(self, key):
setattr(self, key, value)