Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the option to explicitly specify the user for django commands #45537

Merged
merged 1 commit into from Feb 15, 2018

Conversation

Projects
None yet
2 participants
@blarghmatey
Copy link
Contributor

commented Jan 18, 2018

Being able to specify the user to run django commands as can help to prevent permissions issues from cropping up, such as when compiling static assets or migrating a sqlite database which are then owned by root.

What does this PR do?

Adds the runas parameter to the django.command and django.collectstatic functions for specifying the user to execute commands as.

What issues does this PR fix or reference?

N/A

Previous Behavior

All django commands would be executed by whichever user the salt daemon is being executed as.

New Behavior

Django commands can be run as an arbitrary user to avoid permissions issues

Tests written?

No

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@rallytime

This comment has been minimized.

Copy link
Contributor

commented Jan 19, 2018

Thanks for this @blarghmatey - It looks like there are some related test failures here: https://jenkins.saltstack.com/job/PR/job/salt-pr-linode-cent7-py3/1424/#showFailuresLink

unit.modules.test_djangomod.DjangomodCliCommandTestCase.test_django_admin_cli_collectstatic
unit.modules.test_djangomod.DjangomodCliCommandTestCase.test_django_admin_cli_command
unit.modules.test_djangomod.DjangomodCliCommandTestCase.test_django_admin_cli_command_with_args
unit.modules.test_djangomod.DjangomodCliCommandTestCase.test_django_admin_cli_command_with_kwargs
unit.modules.test_djangomod.DjangomodCliCommandTestCase.test_django_admin_cli_command_with_kwargs_ignore_dunder
unit.modules.test_djangomod.DjangomodCliCommandTestCase.test_django_admin_cli_createsuperuser
unit.modules.test_djangomod.DjangomodCliCommandTestCase.test_django_admin_cli_syncdb
unit.modules.test_djangomod.DjangomodCliCommandTestCase.test_django_admin_cli_syncdb_migrate

Can you take a look?

@blarghmatey blarghmatey force-pushed the mitodl:develop branch 2 times, most recently from 935d098 to 4f0b060 Jan 19, 2018

@blarghmatey blarghmatey force-pushed the mitodl:develop branch 2 times, most recently from 17bfa1b to c3e0371 Feb 14, 2018

Added the option to explicitly specify the user for django commands
Being able to specify the user to run django commands as can help to prevent permissions issues from cropping up, such as when compiling static assets or migrating a sqlite database which are then owned by root.

@blarghmatey blarghmatey force-pushed the mitodl:develop branch from c3e0371 to 21774a2 Feb 15, 2018

@blarghmatey

This comment has been minimized.

Copy link
Contributor Author

commented Feb 15, 2018

@rallytime it looks like I've resolved all of the Django related failures in this PR. Let me know if there is anything else that you need me to address before this can get merged. Thanks!

@rallytime rallytime merged commit 907c179 into saltstack:develop Feb 15, 2018

4 of 10 checks passed

default Pull Requests » Salt PR - Main Build - PY2/PY3 #6135
Details
jenkins/PR/salt-pr-linode-ubuntu14-n Pull Requests » Salt PR - Linode Ubuntu14.04 #19956 — ABORTED
Details
jenkins/PR/salt-pr-docs-n Pull Requests » Salt PR - Docs #14708 — FAILURE
Details
jenkins/PR/salt-pr-linode-cent7-py3 Pull Requests » Salt PR - Linode CentOS 7 - PY3 #2317 — FAILURE
Details
jenkins/PR/salt-pr-linode-ubuntu16-py3 Pull Requests » Salt PR - Linode Ubuntu16.04 - PY3 #6874 — FAILURE
Details
jenkins/PR/salt-pr-rs-cent7-n Pull Requests » Salt PR - RS CentOS 7 #16367 — FAILURE
Details
WIP ready for review
Details
codeclimate All good!
Details
jenkins/PR/salt-pr-clone Pull Requests » Salt PR - Clone #22356 — SUCCESS
Details
jenkins/PR/salt-pr-lint-n Pull Requests » Salt PR - Code Lint #19317 — SUCCESS
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.