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
edx
configuration
Commits
51a592d9
Commit
51a592d9
authored
May 11, 2018
by
Kevin Falcone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove xqueue special migration checks
Easier to read with ?w=1 since 80% of this is delete and unindent
parent
4c58cad4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
30 deletions
+23
-30
playbooks/roles/supervisor/defaults/main.yml
+1
-0
playbooks/roles/supervisor/files/pre_supervisor_checks.py
+22
-30
No files found.
playbooks/roles/supervisor/defaults/main.yml
View file @
51a592d9
...
@@ -55,6 +55,7 @@ supervisor_spec:
...
@@ -55,6 +55,7 @@ supervisor_spec:
-
service
:
xqueue
-
service
:
xqueue
python
:
python.xqueue
python
:
python.xqueue
code
:
"
{{
xqueue_code_dir
|
default(None)
}}"
code
:
"
{{
xqueue_code_dir
|
default(None)
}}"
env
:
"
{{
xqueue_app_dir
|
default(none)
}}/xqueue_env"
-
service
:
ecommerce
-
service
:
ecommerce
python
:
python.ecommerce
python
:
python.ecommerce
code
:
"
{{
ecommerce_code_dir
|
default(None)
}}"
code
:
"
{{
ecommerce_code_dir
|
default(None)
}}"
...
...
playbooks/roles/supervisor/files/pre_supervisor_checks.py
View file @
51a592d9
...
@@ -77,7 +77,7 @@ if __name__ == '__main__':
...
@@ -77,7 +77,7 @@ if __name__ == '__main__':
migration_args
.
add_argument
(
"--edxapp-python"
,
migration_args
.
add_argument
(
"--edxapp-python"
,
help
=
"Path to python to use for executing migration check."
)
help
=
"Path to python to use for executing migration check."
)
migration_args
.
add_argument
(
"--edxapp-env"
,
migration_args
.
add_argument
(
"--edxapp-env"
,
help
=
"Location of the e
commerce
environment file."
)
help
=
"Location of the e
dxapp
environment file."
)
xq_migration_args
=
parser
.
add_argument_group
(
"xqueue_migrations"
,
xq_migration_args
=
parser
.
add_argument_group
(
"xqueue_migrations"
,
"Args for running xqueue migration checks."
)
"Args for running xqueue migration checks."
)
...
@@ -85,6 +85,8 @@ if __name__ == '__main__':
...
@@ -85,6 +85,8 @@ if __name__ == '__main__':
help
=
"Location of the xqueue code."
)
help
=
"Location of the xqueue code."
)
xq_migration_args
.
add_argument
(
"--xqueue-python"
,
xq_migration_args
.
add_argument
(
"--xqueue-python"
,
help
=
"Path to python to use for executing migration check."
)
help
=
"Path to python to use for executing migration check."
)
migration_args
.
add_argument
(
"--xqueue-env"
,
help
=
"Location of the xqueue environment file."
)
ecom_migration_args
=
parser
.
add_argument_group
(
"ecommerce_migrations"
,
ecom_migration_args
=
parser
.
add_argument_group
(
"ecommerce_migrations"
,
"Args for running ecommerce migration checks."
)
"Args for running ecommerce migration checks."
)
...
@@ -217,37 +219,27 @@ if __name__ == '__main__':
...
@@ -217,37 +219,27 @@ if __name__ == '__main__':
try
:
try
:
for
service
in
services_for_instance
(
instance_id
):
for
service
in
services_for_instance
(
instance_id
):
if
service
in
MIGRATION_COMMANDS
:
if
service
in
MIGRATION_COMMANDS
:
# Do extra migration related stuff.
services
=
{
if
service
==
'xqueue'
and
args
.
xqueue_code_dir
:
"lms"
:
{
'python'
:
args
.
edxapp_python
,
'env_file'
:
args
.
edxapp_env
,
'code_dir'
:
args
.
edxapp_code_dir
},
cmd
=
MIGRATION_COMMANDS
[
service
]
.
format
(
python
=
args
.
xqueue_python
,
"cms"
:
{
'python'
:
args
.
edxapp_python
,
'env_file'
:
args
.
edxapp_env
,
'code_dir'
:
args
.
edxapp_code_dir
},
code_dir
=
args
.
xqueue_code_dir
)
"ecommerce"
:
{
'python'
:
args
.
ecommerce_python
,
'env_file'
:
args
.
ecommerce_env
,
'code_dir'
:
args
.
ecommerce_code_dir
},
if
os
.
path
.
exists
(
args
.
xqueue_code_dir
):
"credentials"
:
{
'python'
:
args
.
credentials_python
,
'env_file'
:
args
.
credentials_env
,
'code_dir'
:
args
.
credentials_code_dir
},
os
.
chdir
(
args
.
xqueue_code_dir
)
"discovery"
:
{
'python'
:
args
.
discovery_python
,
'env_file'
:
args
.
discovery_env
,
'code_dir'
:
args
.
discovery_code_dir
},
# Run migration check command.
"insights"
:
{
'python'
:
args
.
insights_python
,
'env_file'
:
args
.
insights_env
,
'code_dir'
:
args
.
insights_code_dir
},
output
=
subprocess
.
check_output
(
cmd
,
shell
=
True
)
"analytics_api"
:
{
'python'
:
args
.
analytics_api_python
,
'env_file'
:
args
.
analytics_api_env
,
'code_dir'
:
args
.
analytics_api_code_dir
},
if
'Migrating'
in
output
:
"xqueue"
:
{
'python'
:
args
.
xqueue_python
,
'env_file'
:
args
.
xqueue_env
,
'code_dir'
:
args
.
xqueue_code_dir
},
raise
Exception
(
"Migrations have not been run for {}"
.
format
(
service
))
}
else
:
services
=
{
"lms"
:
{
'python'
:
args
.
edxapp_python
,
'env_file'
:
args
.
edxapp_env
,
'code_dir'
:
args
.
edxapp_code_dir
},
"cms"
:
{
'python'
:
args
.
edxapp_python
,
'env_file'
:
args
.
edxapp_env
,
'code_dir'
:
args
.
edxapp_code_dir
},
"ecommerce"
:
{
'python'
:
args
.
ecommerce_python
,
'env_file'
:
args
.
ecommerce_env
,
'code_dir'
:
args
.
ecommerce_code_dir
},
"credentials"
:
{
'python'
:
args
.
credentials_python
,
'env_file'
:
args
.
credentials_env
,
'code_dir'
:
args
.
credentials_code_dir
},
"discovery"
:
{
'python'
:
args
.
discovery_python
,
'env_file'
:
args
.
discovery_env
,
'code_dir'
:
args
.
discovery_code_dir
},
"insights"
:
{
'python'
:
args
.
insights_python
,
'env_file'
:
args
.
insights_env
,
'code_dir'
:
args
.
insights_code_dir
},
"analytics_api"
:
{
'python'
:
args
.
analytics_api_python
,
'env_file'
:
args
.
analytics_api_env
,
'code_dir'
:
args
.
analytics_api_code_dir
}
}
if
service
in
services
and
all
(
arg
!=
None
for
arg
in
services
[
service
]
.
values
())
and
service
in
MIGRATION_COMMANDS
:
if
service
in
services
and
all
(
arg
!=
None
for
arg
in
services
[
service
]
.
values
())
and
service
in
MIGRATION_COMMANDS
:
serv_vars
=
services
[
service
]
serv_vars
=
services
[
service
]
cmd
=
MIGRATION_COMMANDS
[
service
]
.
format
(
**
serv_vars
)
cmd
=
MIGRATION_COMMANDS
[
service
]
.
format
(
**
serv_vars
)
if
os
.
path
.
exists
(
serv_vars
[
'code_dir'
]):
if
os
.
path
.
exists
(
serv_vars
[
'code_dir'
]):
os
.
chdir
(
serv_vars
[
'code_dir'
])
os
.
chdir
(
serv_vars
[
'code_dir'
])
# Run migration check command.
# Run migration check command.
output
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
)
output
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
)
if
'[ ]'
in
output
:
if
'[ ]'
in
output
:
raise
Exception
(
"Migrations have not been run for {}"
.
format
(
service
))
raise
Exception
(
"Migrations have not been run for {}"
.
format
(
service
))
# Link to available service.
# Link to available service.
...
...
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