summaryrefslogtreecommitdiff
path: root/cloudinit/sources
diff options
context:
space:
mode:
authorJames Falcon <james.falcon@canonical.com>2021-10-19 14:58:56 -0500
committerGitHub <noreply@github.com>2021-10-19 13:58:56 -0600
commit150fd30ef81cea5c2b0aff5127e33a5db786aa09 (patch)
treeaa81b4d150335464760d6db6b14c195030913ae3 /cloudinit/sources
parentee296ced9c0a61b1484d850b807c601bcd670ec1 (diff)
downloadvyos-cloud-init-150fd30ef81cea5c2b0aff5127e33a5db786aa09.tar.gz
vyos-cloud-init-150fd30ef81cea5c2b0aff5127e33a5db786aa09.zip
Update Azure _unpickle (SC-500) (#1067)
When self.failed_desired_api_version was added to DataSourceAzure, the attribute was never added to the _unpickle method using the upgrade framework. This commit adds the attribute. LP: #1946644
Diffstat (limited to 'cloudinit/sources')
-rwxr-xr-xcloudinit/sources/DataSourceAzure.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
index f8641dfd..26c407ef 100755
--- a/cloudinit/sources/DataSourceAzure.py
+++ b/cloudinit/sources/DataSourceAzure.py
@@ -363,7 +363,9 @@ class DataSourceAzure(sources.DataSource):
def _unpickle(self, ci_pkl_version: int) -> None:
super()._unpickle(ci_pkl_version)
- if "iso_dev" not in self.__dict__:
+ if not hasattr(self, "failed_desired_api_version"):
+ self.failed_desired_api_version = False
+ if not hasattr(self, "iso_dev"):
self.iso_dev = None
def __str__(self):