diff --git a/openstack_election/utils.py b/openstack_election/utils.py index 676e7910..ab959fcf 100644 --- a/openstack_election/utils.py +++ b/openstack_election/utils.py @@ -177,7 +177,11 @@ def dir2name(name, projects): def build_candidates_list(election=conf['release']): - project_list = os.listdir(os.path.join(CANDIDATE_PATH, election)) + election_path = os.path.join(CANDIDATE_PATH, election) + if os.path.exists(election_path): + project_list = os.listdir(election_path) + else: + project_list = [] project_list.sort() candidates_lists = {} for project in project_list: