Merge pull request #16 from ader1990/master

If UserDataPlugin cannot find the user_data file, it has to throw ExistingMetadataException
This commit is contained in:
Alessandro Pilotti 2013-09-17 09:04:41 -07:00
commit f325fc4f70

View File

@ -59,8 +59,11 @@ class ConfigDriveService(base.BaseMetadataService):
def _get_data(self, path):
norm_path = os.path.normpath(os.path.join(self._metadata_path, path))
with open(norm_path, 'rb') as f:
return f.read()
try:
with open(norm_path, 'rb') as f:
return f.read()
except IOError:
raise base.NotExistingMetadataException()
def cleanup(self):
if self._metadata_path: