Accept only .yaml files from external configs directory (BMC#16397).
authorMarko Saukko <marko.saukko@cybercom.com>
Thu, 21 Apr 2011 13:45:33 +0000 (16:45 +0300)
committerMarko Saukko <marko.saukko@cybercom.com>
Thu, 21 Apr 2011 14:15:04 +0000 (17:15 +0300)
tools/kickstarter

index 1bed4b4..5b483cb 100755 (executable)
@@ -207,12 +207,14 @@ if __name__ == '__main__':
             ks.process_files(conf, r)
     for path in image_meta['ExternalConfigs']:
         for f in os.listdir(path):
-            if '.yaml' in f:
+            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)
+            else:
+                print "WARNING: File '%s' ignored." % (f)
 
     if options.indexfile:
         str = create_xml(image_meta)