Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
afe10ee7
Commit
afe10ee7
authored
Jul 15, 2016
by
Michael Roytman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix generator expressions to be set comprehensions
parent
8cd7d0c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
util/parsefiles.py
+5
-5
No files found.
util/parsefiles.py
View file @
afe10ee7
...
...
@@ -59,7 +59,7 @@ def _map_roles_to_roles(graph, dirs, git_dir, key, type_1, type_2):
for
item
in
d
.
iterdir
():
# attempts to find meta/*.yml file in item directory tree
roles
=
[
f
for
f
in
item
.
glob
(
"meta/*.yml"
)]
roles
=
{
f
for
f
in
item
.
glob
(
"meta/*.yml"
)}
# if a meta/*.yml file(s) exists for a role
if
roles
:
...
...
@@ -169,7 +169,7 @@ def change_set_to_roles(files, git_dir, roles_dirs, playbooks_dirs, graph):
role_dir_path
=
pathlib2
.
Path
(
git_dir
,
role_dir
)
# get all files in the directories containing roles (i.e. all the roles in that directory)
candidate_files
=
(
f
for
f
in
role_dir_path
.
glob
(
"**/*"
))
candidate_files
=
{
f
for
f
in
role_dir_path
.
glob
(
"**/*"
)}
# for all the files in the change set
for
f
in
files
:
...
...
@@ -186,7 +186,7 @@ def change_set_to_roles(files, git_dir, roles_dirs, playbooks_dirs, graph):
# get all files in directory containing playbook that end with yml extension
# (i.e. all playbooks in that directory)
candidate_files
=
(
f
for
f
in
play_dir_path
.
glob
(
"*.yml"
))
candidate_files
=
{
f
for
f
in
play_dir_path
.
glob
(
"*.yml"
)}
# for all filse in the change set
for
f
in
files
:
...
...
@@ -250,7 +250,7 @@ def get_docker_plays(roles, graph):
items
=
set
()
docker_plays
=
(
node
.
name
for
node
in
graph
.
nodes
()
if
node
.
type
==
"docker_playbook"
)
docker_plays
=
{
node
.
name
for
node
in
graph
.
nodes
()
if
node
.
type
==
"docker_playbook"
}
for
play
in
docker_plays
:
# all roles that are used by play
...
...
@@ -347,7 +347,7 @@ if __name__ == '__main__':
# aws_plays_paths:
# - <all paths relative to configuration repository that contain aws Ansible playbooks>
# docker_plays_paths:
# - <all paths relative to configuration reposit
ro
y that contain Docker Ansible playbooks>
# - <all paths relative to configuration reposit
or
y that contain Docker Ansible playbooks>
# read config file
config
=
_open_yaml_file
(
CONFIG_FILE_PATH
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment