diff --git a/openstack_election/cmds/ci_check_all_candidate_files.py b/openstack_election/cmds/ci_check_all_candidate_files.py index bf7fdffc..4a85bce7 100755 --- a/openstack_election/cmds/ci_check_all_candidate_files.py +++ b/openstack_election/cmds/ci_check_all_candidate_files.py @@ -84,7 +84,8 @@ def find_modified_candidate_files(): filenames = [ l.strip() for l in results.splitlines() - if l.startswith(utils.CANDIDATE_PATH + '/') + if (l.startswith(utils.CANDIDATE_PATH + '/') and + not l.endswith('.placeholder')) ] return filenames diff --git a/openstack_election/tests/cmds/test_ci_checks.py b/openstack_election/tests/cmds/test_ci_checks.py index 3003f171..9ff27ef8 100644 --- a/openstack_election/tests/cmds/test_ci_checks.py +++ b/openstack_election/tests/cmds/test_ci_checks.py @@ -35,7 +35,7 @@ class TestFindModifiedCandidateFiles(base.ElectionTestCase): check_output = (('configuration.yaml\n' '%(path)s/.placeholder\n' ) % ({'path': utils.CANDIDATE_PATH})).encode('utf-8') - expected_filenames = ['%s/.placeholder' % utils.CANDIDATE_PATH] + expected_filenames = [] mock_check_output.return_value = check_output filenames = \ ci_check_all_candidate_files.find_modified_candidate_files() @@ -48,9 +48,7 @@ class TestFindModifiedCandidateFiles(base.ElectionTestCase): '%(path)s/cadidate\n' '%(path)s/.placeholder\n' ) % ({'path': utils.CANDIDATE_PATH})).encode('utf-8') - expected_filenames = ['%s/cadidate' % utils.CANDIDATE_PATH, - '%s/.placeholder' % utils.CANDIDATE_PATH - ] + expected_filenames = ['%s/cadidate' % utils.CANDIDATE_PATH] mock_check_output.return_value = check_output filenames = \ ci_check_all_candidate_files.find_modified_candidate_files()