Updated if statements for conciseness

pull/5335/head
Jenny Plunkett 2017-10-17 14:51:34 -05:00 committed by Kevin Gilbert
parent b3e8dec8ea
commit 5fbc88f6b6
1 changed files with 5 additions and 10 deletions

View File

@ -10,11 +10,10 @@ TARGET_CONFIGS = json_file_to_dict(join(CONFIG_DIR, "target_configs.json"))
def get_valid_configs(target_name): def get_valid_configs(target_name):
if target_name in TARGET_CONFIGS: if target_name in TARGET_CONFIGS:
target_config = TARGET_CONFIGS[target_name] target_config = TARGET_CONFIGS[target_name]
elif (target_name in TARGET_MAP and 'LWIP' in TARGET_MAP[target_name].features):
target_config = { "default_test_configuration": "ETHERNET", "test_configurations": ["ETHERNET"] }
else: else:
if 'LWIP' in TARGET_MAP[target_name].features: return {}
target_config = { "default_test_configuration": "ETHERNET", "test_configurations": ["ETHERNET"] }
else:
return {}
config_dict = {} config_dict = {}
for attr in CONFIG_MAP: for attr in CONFIG_MAP:
@ -35,11 +34,7 @@ def get_default_config(target_name):
if config_name == "NONE": if config_name == "NONE":
return None return None
return join(CONFIG_DIR, CONFIG_MAP[config_name]) return join(CONFIG_DIR, CONFIG_MAP[config_name])
elif target_name in TARGET_MAP: elif (target_name in TARGET_MAP and 'LWIP' in TARGET_MAP[target_name].features):
if 'LWIP' in TARGET_MAP[target_name].features: return join(CONFIG_DIR, CONFIG_MAP["ETHERNET"])
config_name = "ETHERNET"
return join(CONFIG_DIR, CONFIG_MAP[config_name])
else:
return None
else: else:
return None return None