Skip to content

Commit 1b736ca

Browse files
Address review comments
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1 parent c9ceede commit 1b736ca

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

scanpipe/pipes/d2d_config.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -129,42 +129,32 @@ def load_ecosystem_config(pipeline, options):
129129
- which source files to get source symbols from
130130
- which unmapped paths to ignore in deployed binaries
131131
"""
132-
configs_by_ecosystem = {
133-
ecosystem.ecosystem_option: ecosystem
134-
for ecosystem in ECOSYSTEM_CONFIGS.values()
135-
}
136-
137132
# Add default configurations which are common accross ecosystems
138133
pipeline.ecosystem_config = ECOSYSTEM_CONFIGS.get("Default")
139134

140135
# Add configurations for each selected ecosystem
141136
for selected_option in options:
142-
if selected_option not in configs_by_ecosystem:
137+
if selected_option not in ECOSYSTEM_CONFIGS:
143138
continue
144139

140+
ecosystem_config = get_ecosystem_config(ecosystem=selected_option)
145141
add_ecosystem_config(
146142
pipeline_ecosystem_config=pipeline.ecosystem_config,
147-
configs_by_ecosystem=configs_by_ecosystem,
148-
selected_option=selected_option,
143+
ecosystem_config=ecosystem_config,
149144
)
150145

151146

152-
def add_ecosystem_config(
153-
pipeline_ecosystem_config, configs_by_ecosystem, selected_option
154-
):
147+
def add_ecosystem_config(pipeline_ecosystem_config, ecosystem_config):
155148
"""
156-
Set the `pipeline_ecosystem_config` values from all the individual ecosystem
157-
based configurations defined in `configs_by_ecosystem`, based on pipeline
158-
`selected_option` which selects an ecosytem.
149+
Set the `pipeline_ecosystem_config` values from an individual ecosystem
150+
based configuration defined in `ecosystem_config`.
159151
"""
160152
d2d_pipeline_configs = [
161153
"purldb_package_extensions",
162154
"purldb_resource_extensions",
163155
"deployed_resource_path_exclusions",
164156
]
165157

166-
ecosystem_config = configs_by_ecosystem.get(selected_option)
167-
168158
for config_name in d2d_pipeline_configs:
169159
config_value = getattr(ecosystem_config, config_name)
170160
pipeline_config_value = getattr(pipeline_ecosystem_config, config_name)

0 commit comments

Comments
 (0)