Closed Bug 1069290 Opened 10 years ago Closed 10 years ago

Remove redundant "--settings treeherder.settings" from update.py

Categories

(Tree Management :: Treeherder, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

Details

Attachments

(2 files)

manage.py set the DJANGO_SETTINGS_MODULE env variable:
https://github.com/mozilla/treeherder-service/blob/master/manage.py#L6

So afaict we shouldn't need to pass in the --settings treeherder.settings in update.py:
https://github.com/mozilla/treeherder-service/blob/master/deployment/update/update.py#L20
https://github.com/mozilla/treeherder-service/blob/master/deployment/update/update.py#L47

According to:
https://docs.djangoproject.com/en/1.5/topics/settings/#designating-the-settings

Not exactly high priority, but:
a) If we ever change the settings value in manage.py, update.py will be out of sync
b) I was using update.py as a command cheatsheet and was pointlessly typing out the --settings foo each time.
Attachment #8492575 - Flags: review?(mdoglio) → review+
Commit pushed to master at https://github.com/mozilla/treeherder-service

https://github.com/mozilla/treeherder-service/commit/2b8b12db78f9216d185d2020d566e02ec0f1b75d
Bug 1069290 - Remove redundant manage.py params from the deploy script

manage.py sets the DJANGO_SETTINGS_MODULE env variable, so it's
unnecessary to pass |--settings ...| when we call it from the Chief
deploy script.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
So unfortunately with the patch that has landed, since manage.py uses setdefault(), it means we only set DJANGO_SETTINGS_MODULE if it was not already defined in the environment. However for the Chief deploys, it is already set to "chief.settings":
http://treeherderadm.private.scl3.mozilla.com/chief/treeherder.prod/logs/master.1411472040

Given that one off commands can use --settings "foo" to override the value of DJANGO_SETTINGS_MODULE, I'd prefer to just set DJANGO_SETTINGS_MODULE unconditionally to "treeherder.settings", rather than have to make update.py unnecessarily complicated.
Attachment #8493686 - Flags: review?(mdoglio)
Attachment #8493686 - Flags: review?(mdoglio) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: