This issue has been fixed in version 24.3 (https://github.com/canonical/cloud-init/releases/tag/24.3). This version simply needs to be merged from upstream.