Replace the hard-coded temp path in gunicorn module (#38349)
The gunicorn module has a hard-coded reference to '/tmp' which may or may not be the actual temp directory for an operating system. This patch replaces '/tmp' with module.tmpdir which should resolve to the correct temp directory for the OS. Fixes Issue #36953 Signed-off-by: Eric Brown <browne@vmware.com>
This commit is contained in:
parent
b794fa4fe7
commit
4e38036bbd
1 changed files with 8 additions and 8 deletions
|
@ -130,14 +130,6 @@ def main():
|
|||
'user': '-u',
|
||||
}
|
||||
|
||||
# temporary files in case no option provided
|
||||
tmp_error_log = '/tmp/gunicorn.temp.error.log'
|
||||
tmp_pid_file = '/tmp/gunicorn.temp.pid'
|
||||
|
||||
# remove temp file if exists
|
||||
remove_tmp_file(tmp_pid_file)
|
||||
remove_tmp_file(tmp_error_log)
|
||||
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
app=dict(required=True, type='str', aliases=['name']),
|
||||
|
@ -153,6 +145,14 @@ def main():
|
|||
)
|
||||
)
|
||||
|
||||
# temporary files in case no option provided
|
||||
tmp_error_log = os.path.join(module.tmpdir, 'gunicorn.temp.error.log')
|
||||
tmp_pid_file = os.path.join(module.tmpdir, 'gunicorn.temp.pid')
|
||||
|
||||
# remove temp file if exists
|
||||
remove_tmp_file(tmp_pid_file)
|
||||
remove_tmp_file(tmp_error_log)
|
||||
|
||||
# obtain app name and venv
|
||||
params = module.params
|
||||
app = params['app']
|
||||
|
|
Loading…
Reference in a new issue