@@ -38,11 +38,11 @@ def _extract_group_from_community_files(files):
3838 return content .strip ('{ }' ).replace ('_' , '' ).split ('.' )[- 1 ]
3939
4040
41- def _sort_ans_repos_by_group (ans_repos ):
41+ def _group_ans_repos_by_group (ans_repos ):
4242 ans_repos_by_group = {}
4343 for repo in ans_repos :
44- files = ans_repos [ repo ][ 'community_files' ]
45- group = _extract_group_from_community_files ( files )
44+ group = _extract_group_from_community_files (
45+ ans_repos [ repo ][ 'community_files' ] )
4646 if group in ans_repos_by_group :
4747 ans_repos_by_group [group ].append (repo )
4848 else :
@@ -51,7 +51,7 @@ def _sort_ans_repos_by_group(ans_repos):
5151
5252
5353def get_mismatched_repos (tf_repos , ans_repos , repos_missing ):
54- ans_repos_new = _sort_ans_repos_by_group (ans_repos )
54+ ans_repos_new = _group_ans_repos_by_group (ans_repos )
5555 tf_repos_new = {k .lower (): v for k , v in tf_repos .items ()}
5656
5757 mismatched_repos = []
@@ -77,10 +77,11 @@ def main():
7777 repos_missing )
7878
7979 print ('The following repos are assigned to different codeowner groups in '
80- 'the Ansible source-repositories and the Terraform tfvars: '
81- f'{ mismatched_repos } ' )
80+ 'the Ansible source-repositories and the Terraform tfvars: '
81+ f'{ mismatched_repos } ' )
8282
8383 return len (repos_missing ) > 0 or len (mismatched_repos ) > 0
8484
85+
8586if __name__ == "__main__" :
8687 sys .exit (main ())
0 commit comments