Skip to content

fix: Fall back to cached local ds if no valid ds found (#4997)

Ani Sinha requested to merge anisinha/cloud-init:c10s-32854 into c10s

Jira: https://issues.redhat.com/browse/RHEL-32854

Rebooting an instance which has finished VMware guest
customization with DataSourceVMware will load
DataSourceNone due to metadata is NOT available.

This is mostly a re-post of PR#229, few differences are:
1. Let ds decide if fallback is allowed, not always fall back
   to previous cached LOCAL ds.
2. No comparing instance-id of cached ds with previous instance-id
   due to I think they are always identical.

Fixes GH-3402

(cherry picked from commit 9929a00580d50afc60bf4e0fb9f2f39d4f797b4b)
Signed-off-by: Ani Sinha <anisinha@redhat.com>

Conflicts:
        cloudinit/sources/__init__.py
        Conflicts because of changes in upstream source coming from
        30d5e9a3358f4cbaced ("refactor: Use _unpickle rather than hasattr() in sources")

Merge request reports