Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
elyousfi5 committed Dec 3, 2024
1 parent 13a4992 commit 2517c31
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ostorlab/runtimes/local/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def stop(self, scan_id: str) -> None:
network_labels = network.attrs["Labels"]
if (
network_labels is not None
and network_labels.get("ostorlab.universe") == scan_id
and int(network_labels.get("ostorlab.universe")) == scan_id
):
logger.info("removing network %s", network_labels)
stopped_network.append(network)
Expand All @@ -320,7 +320,10 @@ def stop(self, scan_id: str) -> None:
configs = self._docker_client.configs.list()
for config in configs:
config_labels = config.attrs["Spec"]["Labels"]
if config_labels.get("ostorlab.universe") == scan_id:
if (

Check warning on line 323 in src/ostorlab/runtimes/local/runtime.py

View check run for this annotation

Codecov / codecov/patch

src/ostorlab/runtimes/local/runtime.py#L323

Added line #L323 was not covered by tests
config_labels.get("ostorlab.universe") is not None
and int(config_labels.get("ostorlab.universe")) == scan_id
):
logger.info("removing config %s", config_labels)
stopped_configs.append(config)
config.remove()
Expand Down

0 comments on commit 2517c31

Please sign in to comment.