diff options
author | Vlastimil Holer <vlastimil.holer@gmail.com> | 2012-12-20 17:16:47 +0100 |
---|---|---|
committer | Vlastimil Holer <vlastimil.holer@gmail.com> | 2012-12-20 17:16:47 +0100 |
commit | 2efdb4b8d1c17eea352ae0dc022d2ddca80833da (patch) | |
tree | 9e28b8fbf0c4f0e683ae9501f5e92b6ed8e782db /cloudinit/sources/DataSourceOpenNebula.py | |
parent | 46e646fabf3a0f2593dc9d9f231fd075134de36f (diff) | |
download | vyos-cloud-init-2efdb4b8d1c17eea352ae0dc022d2ddca80833da.tar.gz vyos-cloud-init-2efdb4b8d1c17eea352ae0dc022d2ddca80833da.zip |
Fix exception handlers for data read. Fix name read_context_disk_dir.
Diffstat (limited to 'cloudinit/sources/DataSourceOpenNebula.py')
-rw-r--r-- | cloudinit/sources/DataSourceOpenNebula.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/sources/DataSourceOpenNebula.py b/cloudinit/sources/DataSourceOpenNebula.py index 967d7170..2f1ce459 100644 --- a/cloudinit/sources/DataSourceOpenNebula.py +++ b/cloudinit/sources/DataSourceOpenNebula.py @@ -58,7 +58,7 @@ class DataSourceOpenNebula(sources.DataSource): results = {} if os.path.isdir(self.seed_dir): try: - results=read_on_context_device_dir(self.seed_dir) + results=read_context_disk_dir(self.seed_dir) found = self.seed_dir except NonContextDeviceDir: util.logexc(LOG, "Failed reading context device from %s", @@ -70,10 +70,8 @@ class DataSourceOpenNebula(sources.DataSource): results = util.mount_cb(dev, read_context_disk_dir) found = dev break - except (NonConfigDriveDir, util.MountFailedError): + except (NonContextDeviceDir, util.MountFailedError): pass - except BrokenConfigDriveDir: - util.logexc(LOG, "broken config drive: %s", dev) if not found: return False @@ -211,6 +209,8 @@ def read_context_disk_dir(source_dir): except util.ProcessExecutionError, _err: LOG.warn("Failed to read context variables: %s" % (_err.message)) results['metadata']=context_sh + else: + raise NonContextDeviceDir("Missing context.sh") # process single or multiple SSH keys if "ssh_key" in context_sh: |