From b47e0c76ecd120c80133822f5f60e2b7b885ea2c Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Thu, 13 Aug 2015 13:03:18 +0200 Subject: [PATCH] Optionally check for diskimages on nodepool log generation tool This tool assumes that diskimages option is always present on nodepool configuration. For downstream consumption, it may not be the case, so checking if setting is present. Change-Id: I901e044ae9ec37eb64bc662e4182d317cf4a7647 --- tools/nodepool_log_config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/nodepool_log_config.py b/tools/nodepool_log_config.py index e04c899975..ff01f0eca8 100755 --- a/tools/nodepool_log_config.py +++ b/tools/nodepool_log_config.py @@ -129,8 +129,9 @@ def _get_providers_and_images(config_file): logging.debug("Added %d providers & images" % len(ret)) # diskimages have a special provider - for diskimage in config['diskimages']: - ret.append(('dib', diskimage['name'])) + if 'diskimages' in config: + for diskimage in config['diskimages']: + ret.append(('dib', diskimage['name'])) return ret