summaryrefslogtreecommitdiff
path: root/cloudinit/tests
diff options
context:
space:
mode:
authorJames Falcon <TheRealFalcon@users.noreply.github.com>2021-04-19 11:31:28 -0500
committerGitHub <noreply@github.com>2021-04-19 12:31:28 -0400
commitd132356cc361abef2d90d4073438f3ab759d5964 (patch)
treebe17b95ad72951ada102204d7f52f62ccc430395 /cloudinit/tests
parent45db197cfc7e3488baae7dc1053c45da070248f6 (diff)
downloadvyos-cloud-init-d132356cc361abef2d90d4073438f3ab759d5964.tar.gz
vyos-cloud-init-d132356cc361abef2d90d4073438f3ab759d5964.zip
fix error on upgrade caused by new vendordata2 attributes (#869)
In #777, we added 'vendordata2' and 'vendordata2_raw' attributes to the DataSource class, but didn't use the upgrade framework to deal with an unpickle after upgrade. This commit adds the necessary upgrade code. Additionally, added a smaller-scope upgrade test to our integration tests that will be run on every CI run so we catch these issues immediately in the future. LP: #1922739
Diffstat (limited to 'cloudinit/tests')
-rw-r--r--cloudinit/tests/test_upgrade.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cloudinit/tests/test_upgrade.py b/cloudinit/tests/test_upgrade.py
index 05eefd2a..da3ab23b 100644
--- a/cloudinit/tests/test_upgrade.py
+++ b/cloudinit/tests/test_upgrade.py
@@ -46,3 +46,7 @@ class TestUpgrade:
def test_paths_has_run_dir_attribute(self, previous_obj_pkl):
assert previous_obj_pkl.paths.run_dir is not None
+
+ def test_vendordata_exists(self, previous_obj_pkl):
+ assert previous_obj_pkl.vendordata2 is None
+ assert previous_obj_pkl.vendordata2_raw is None