+
+def read_configuration_file(filename):
+ # read in and store all variables in VARS_FILE into each line
+ # is in the format name=val (any whitespace around the = is
+ # removed. everything after the = to the end of the line is
+ # the value
+ vars = {}
+ vars_file= file(filename,'r')
+ validConfFile = True
+ for line in vars_file:
+ # if its a comment or a whitespace line, ignore
+ if line[:1] == "#" or string.strip(line) == "":
+ continue
+
+ parts= string.split(line,"=")
+ if len(parts) != 2:
+ validConfFile = False
+ raise Exception( "Invalid line in vars file: %s" % line )
+
+ name= string.strip(parts[0])
+ value= string.strip(parts[1])
+ value= value.replace("'", "") # remove quotes
+ value= value.replace('"', "") # remove quotes
+ vars[name]= value
+
+ vars_file.close()
+ if not validConfFile:
+ raise Exception( "Unable to read configuration vars." )
+
+ # find out which directory we are running it, and set a variable
+ # for that. future steps may need to get files out of the bootmanager
+ # directory
+ current_dir= os.getcwd()
+ vars['BM_SOURCE_DIR']= current_dir
+
+ return vars
+