You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Idea on refactoring repetitive if statements in the scanner.py
# crawl_name: client_name map# crawl_name indicates the string depending on which crawl factory will work# client_name indicates the string depending on which current client factory works# crawl_name in the client_factory will be chosen in such a way that it matches with the keys in the config filecrawl_client_map= {
'compute_instances': 'compute',
'compute_images': 'compute',
'machine_images': 'compute',
'compute_disks': 'compute',
'static_ips': 'compute',
'app_services': 'appengine',
'storage_buckets': 'storage',
'managed_zones': 'managed_zones',
# and so on
}
# replacing the repetitive if statementsforcrawler_name, client_nameincrawl_client_map.items():
ifis_set(scan_config, crawler_name):
CrawlFactory.create_crawler(crawler_name).crawl(
project_id,
ClientFactory.get_client(client_name).get_service(credentials),
)
The text was updated successfully, but these errors were encountered:
related to #153
Idea on refactoring repetitive if statements in the
scanner.py
The text was updated successfully, but these errors were encountered: