summaryrefslogtreecommitdiff
path: root/cloudinit/DataSourceEc2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/DataSourceEc2.py')
-rw-r--r--cloudinit/DataSourceEc2.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/cloudinit/DataSourceEc2.py b/cloudinit/DataSourceEc2.py
index 8a79eb5f..54cbc69c 100644
--- a/cloudinit/DataSourceEc2.py
+++ b/cloudinit/DataSourceEc2.py
@@ -45,17 +45,13 @@ class DataSourceEc2(DataSource.DataSource):
return("DataSourceEc2")
def get_data(self):
- try:
- (md,ud) = util.read_seeded(self.cachedir + "/")
- self.userdata_raw = ud
- self.metadata = md
- cloudinit.log.debug("using seeded ec2 cache data in %s" % self.cachedir)
+ seedret={ }
+ if util.read_optional_seed(seedret,base=self.cachedir + "/"):
+ self.userdata_raw = seedret['user-data']
+ self.metadata = seedret['meta-data']
+ cloudinit.log.debug("using seeded ec2 data in %s" % self.cachedir)
return True
- except OSError, e:
- if e.errno != errno.ENOENT:
- cloudinit.log.warn("unexpected error from preseeded data")
- raise
-
+
try:
if not self.wait_for_metadata_service():
return False