mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 06:51:10 +03:00
Demote settings imports in main utils
This commit is contained in:
parent
ec887f877f
commit
91527228db
@ -21,9 +21,6 @@ from rest_framework.exceptions import ParseError, PermissionDenied
|
|||||||
# PyCrypto
|
# PyCrypto
|
||||||
from Crypto.Cipher import AES
|
from Crypto.Cipher import AES
|
||||||
|
|
||||||
# Tower
|
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['get_object_or_400', 'get_object_or_403', 'camelcase_to_underscore',
|
__all__ = ['get_object_or_400', 'get_object_or_403', 'camelcase_to_underscore',
|
||||||
'get_ansible_version', 'get_awx_version', 'update_scm_url',
|
'get_ansible_version', 'get_awx_version', 'update_scm_url',
|
||||||
@ -406,6 +403,7 @@ def check_proot_installed():
|
|||||||
'''
|
'''
|
||||||
Check that proot is installed.
|
Check that proot is installed.
|
||||||
'''
|
'''
|
||||||
|
from django.conf import settings
|
||||||
cmd = [getattr(settings, 'AWX_PROOT_CMD', 'proot'), '--version']
|
cmd = [getattr(settings, 'AWX_PROOT_CMD', 'proot'), '--version']
|
||||||
try:
|
try:
|
||||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||||
@ -432,6 +430,7 @@ def wrap_args_with_proot(args, cwd, **kwargs):
|
|||||||
- /var/log/supervisor
|
- /var/log/supervisor
|
||||||
- /tmp (except for own tmp files)
|
- /tmp (except for own tmp files)
|
||||||
'''
|
'''
|
||||||
|
from django.conf import settings
|
||||||
new_args = [getattr(settings, 'AWX_PROOT_CMD', 'proot'), '-r', '/']
|
new_args = [getattr(settings, 'AWX_PROOT_CMD', 'proot'), '-r', '/']
|
||||||
hide_paths = ['/etc/tower', '/var/lib/awx', '/var/log',
|
hide_paths = ['/etc/tower', '/var/lib/awx', '/var/log',
|
||||||
tempfile.gettempdir(), settings.PROJECTS_ROOT,
|
tempfile.gettempdir(), settings.PROJECTS_ROOT,
|
||||||
|
Loading…
Reference in New Issue
Block a user