Cleaning up cfg so that others can know the difference between empty vars and vars that don't exist

This commit is contained in:
Joshua Harlow
2012-03-09 14:45:24 -08:00
parent 358969812f
commit 2d99e9ecca
11 changed files with 92 additions and 103 deletions

View File

@@ -269,12 +269,11 @@ class ImageCreationService:
#extract them from the config
try:
flat_urls = self.cfg.get('img', 'image_urls')
if flat_urls:
expanded_urls = [x.strip() for x in flat_urls.split(',')]
for url in expanded_urls:
if url:
urls.append(url)
flat_urls = self.cfg.getdefaulted('img', 'image_urls', [])
expanded_urls = [x.strip() for x in flat_urls.split(',')]
for url in expanded_urls:
if url:
urls.append(url)
except(ConfigParser.Error):
LOG.warn("No image configuration keys found, skipping glance image install!")