summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Yi <yix.li@intel.com>2011-06-09 19:27:11 +0800
committerLi Yi <yix.li@intel.com>2011-06-22 10:57:46 +0800
commit68b6d0dc03a094e88f2d5357e9355b0f2e074937 (patch)
treec67b6217bfda63a0cac3df9cf51d2cfe4753829f
parente878a04307cd6795689b5609c5d1ca9c965c6ecf (diff)
downloadkickstarter-68b6d0dc03a094e88f2d5357e9355b0f2e074937.tar.gz
kickstarter-68b6d0dc03a094e88f2d5357e9355b0f2e074937.tar.bz2
kickstarter-68b6d0dc03a094e88f2d5357e9355b0f2e074937.zip
enable/disable image generation with 'Active' key (BMC#18692)
-rwxr-xr-xtools/kickstarter17
1 files changed, 12 insertions, 5 deletions
diff --git a/tools/kickstarter b/tools/kickstarter
index 9deb24f..dd71b70 100755
--- a/tools/kickstarter
+++ b/tools/kickstarter
@@ -173,7 +173,8 @@ def create_xml(image_meta):
fp = file('%s/%s' %(path, f), 'r')
local = yaml.load(fp)
conf = ks.parse(local)
- image_xml(root,conf)
+ if conf.has_key('Active') and conf['Active']:
+ image_xml(root,conf)
str = etree.tostring(root, pretty_print=True)
return str
@@ -210,16 +211,22 @@ if __name__ == '__main__':
if image_meta.has_key('Configurations'):
for img in image_meta['Configurations']:
conf = ks.parse(img)
- print "Creating %s (%s.ks)" %(img['Name'], img['FileName'] )
- ks.process_files(conf, r)
+ if conf.has_key('Active') and conf['Active']:
+ print "Creating %s (%s.ks)" %(img['Name'], img['FileName'] )
+ ks.process_files(conf, r)
+ else:
+ print "%s is inactive, not generate %s this time" %(img['Name'], img['FileName'] )
for path in image_meta['ExternalConfigs']:
for f in os.listdir(path):
if f.endswith('.yaml'):
fp = file('%s/%s' %(path, f), 'r')
local = yaml.load(fp)
conf = ks.parse(local)
- print "Creating %s (%s.ks)" %(conf['Name'], conf['FileName'] )
- ks.process_files(conf, r)
+ if conf.has_key('Active') and conf['Active']:
+ print "Creating %s (%s.ks)" %(conf['Name'], conf['FileName'] )
+ ks.process_files(conf, r)
+ else:
+ print "%s is inactive, not generate %s this time" %(conf['Name'], conf['FileName'] )
else:
print "WARNING: File '%s' ignored." % (f)