Skip to content

Commit

Permalink
bug(maas): register the correct DatasourceMAASLocal in init-local (#5068
Browse files Browse the repository at this point in the history
)

Incorrectly registering DataSourceMAAS for init-local DEP_FILESYSTEM
inadvertently short-circuits the _get_data checks performed by
DataSourceMAASLocal for presence of network config from initramfs.
This results in a 2 minute timeout on physical system
reboots because the network stage DataSourceMAAS expects all system
networking is already configured and the IMDS to be accessible.

Correct this registration to do the proper initramfs checks and avoid
trying to perform GETs against the IMDS in init-local timeframe when
we know network is not yet available.

Fixes GH-5064
LP: #2057763
  • Loading branch information
blackboxsw committed Mar 19, 2024
1 parent d8e3a4b commit dbe6739
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cloudinit/sources/DataSourceMAAS.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class MAASSeedDirMalformed(Exception):

# Used to match classes to dependencies
datasources = [
(DataSourceMAAS, (sources.DEP_FILESYSTEM,)),
(DataSourceMAASLocal, (sources.DEP_FILESYSTEM,)),
(DataSourceMAAS, (sources.DEP_FILESYSTEM, sources.DEP_NETWORK)),
]

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/sources/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
Hetzner.DataSourceHetzner,
IBMCloud.DataSourceIBMCloud,
LXD.DataSourceLXD,
MAAS.DataSourceMAAS,
MAAS.DataSourceMAASLocal,
NoCloud.DataSourceNoCloud,
OpenNebula.DataSourceOpenNebula,
Oracle.DataSourceOracle,
Expand Down

0 comments on commit dbe6739

Please sign in to comment.