Making config optional

This commit removes the requirement for having a config file.
Sometimes projects may want to use one to list out tests, define
a profile, or override a setting, but they are no longer required.

Change-Id: I6e467f58b2b27cae647901ac2c3f75a764e74c0c
This commit is contained in:
Travis McPeak
2016-02-10 15:55:43 -08:00
parent 67ed78447c
commit 54a06aaebb
10 changed files with 43 additions and 218 deletions

View File

@@ -79,7 +79,9 @@ class BanditManager():
self.scores = []
def _get_profile(self, profile_name):
if profile_name not in self.b_conf.config['profiles']:
if(not self.b_conf.get_option('profiles') or
profile_name not in self.b_conf.config['profiles']):
raise utils.ProfileNotFound(self.b_conf.config_file, profile_name)
profile = self.b_conf.config['profiles'][profile_name]