From 83f6bbfbe5b924be61a3c098f4202377d69c8947 Mon Sep 17 00:00:00 2001 From: lucasmoura Date: Mon, 12 Apr 2021 13:22:22 -0300 Subject: Fix unpickle for source paths missing run_dir (#863) On the datasource class, we require the use of paths.run_dir to perform some operations. On older cloud-init version, the Paths class does not have the run_dir attribute. To fix that, we are now manually adding that attribute in the Paths object if doesn't exist in the unpickle operation. LP: #1899299 --- cloudinit/tests/test_upgrade.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cloudinit/tests') diff --git a/cloudinit/tests/test_upgrade.py b/cloudinit/tests/test_upgrade.py index f79a2536..05eefd2a 100644 --- a/cloudinit/tests/test_upgrade.py +++ b/cloudinit/tests/test_upgrade.py @@ -43,3 +43,6 @@ class TestUpgrade: def test_blacklist_drivers_set_on_networking(self, previous_obj_pkl): """We always expect Networking.blacklist_drivers to be initialised.""" assert previous_obj_pkl.distro.networking.blacklist_drivers is None + + def test_paths_has_run_dir_attribute(self, previous_obj_pkl): + assert previous_obj_pkl.paths.run_dir is not None -- cgit v1.2.3