diff options
Diffstat (limited to 'cloudinit/sources/__init__.py')
-rw-r--r-- | cloudinit/sources/__init__.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cloudinit/sources/__init__.py b/cloudinit/sources/__init__.py index d49b67b2..74944e38 100644 --- a/cloudinit/sources/__init__.py +++ b/cloudinit/sources/__init__.py @@ -68,13 +68,18 @@ class DataSource(object): return self._filter_userdata(self.userdata) return self.userdata - def get_launch_index(self): + @property + def launch_index(self): + if not self.metadata: + return None + if 'launch-index' in self.metadata: + return self.metadata['launch-index'] return None def _filter_userdata(self, processed_ud): if not processed_ud: return processed_ud - idx = self.get_launch_index() + idx = self.launch_index if idx is None: return processed_ud # First do a scan to see if any one with launch-index |