Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ensure network config in DataSourceOracle can be unpickled #5073

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cloudinit/sources/DataSourceOracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ class DataSourceOracle(sources.DataSource):
sources.NetworkConfigSource.INITRAMFS,
)

_network_config: dict = {"config": [], "version": 1}
perform_dhcp_setup = True

# Careful...these can be overridden in __init__
Expand All @@ -141,6 +140,7 @@ def __init__(self, sys_cfg, *args, **kwargs):
]
)
self._network_config_source = KlibcOracleNetworkConfigSource()
self._network_config: dict = {"config": [], "version": 1}

url_params = self.get_url_params()
self.url_max_wait = url_params.max_wait_seconds
Expand All @@ -156,6 +156,8 @@ def _unpickle(self, ci_pkl_version: int) -> None:
"_network_config_source",
KlibcOracleNetworkConfigSource(),
)
if not hasattr(self, "_network_config"):
self._network_config = {"config": [], "version": 1}

def _has_network_config(self) -> bool:
return bool(self._network_config.get("config", []))
Expand Down
Loading