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

@blarghmatey
Copy link
Contributor

@blarghmatey blarghmatey 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
Copy link
Contributor

@rallytime rallytime 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 develop branch 2 times, most recently from 935d098 to 4f0b060 Jan 19, 2018
@blarghmatey blarghmatey force-pushed the develop branch 2 times, most recently from 17bfa1b to c3e0371 Feb 14, 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.
@blarghmatey
Copy link
Contributor Author

@blarghmatey blarghmatey 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants