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
23207c69
Commit
23207c69
authored
Sep 15, 2014
by
Feanil Patel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't run pre-supervisor on abbey builds.
parent
11ee7016
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
playbooks/roles/supervisor/files/pre_supervisor_checks.py
+15
-0
No files found.
playbooks/roles/supervisor/files/pre_supervisor_checks.py
View file @
23207c69
...
...
@@ -96,6 +96,16 @@ if __name__ == '__main__':
instance_id
=
get_instance_metadata
()[
'instance-id'
]
prefix
=
instance_id
ec2
=
boto
.
connect_ec2
()
reservations
=
ec2
.
get_all_instances
(
instance_ids
=
[
instance_id
])
instance
=
reservations
[
0
]
.
instances
[
0
]
if
instance
.
instance_profile
[
'arn'
]
.
endswith
(
'/abbey'
):
print
(
"Running an abbey build. Not starting any services."
)
# Needs to exit with 1 instead of 0 to prevent
# services from starting.
exit
(
1
)
try
:
environment
,
deployment
,
play
=
edp_for_instance
(
instance_id
)
prefix
=
"{environment}-{deployment}-{play}-{instance_id}"
.
format
(
...
...
@@ -103,6 +113,10 @@ if __name__ == '__main__':
deployment
=
deployment
,
play
=
play
,
instance_id
=
instance_id
)
except
:
print
(
"Failed to get EDP for {}"
.
format
(
instance_id
))
try
:
for
service
in
services_for_instance
(
instance_id
):
if
service
in
MIGRATION_COMMANDS
:
# Do extra migration related stuff.
...
...
@@ -144,6 +158,7 @@ if __name__ == '__main__':
print
(
msg
)
if
notify
:
notify
(
msg
)
traceback
.
print_exc
()
else
:
msg
=
"{}: {}"
.
format
(
prefix
,
" | "
.
join
(
report
))
print
(
msg
)
...
...
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