Skip to content

Commit 4b46314

Browse files
committed
Merge pull request #348 from helgi/prune_settings
Clean up the settings file a bit
2 parents bd63f4e + 35a4bff commit 4b46314

4 files changed

Lines changed: 14 additions & 34 deletions

File tree

rootfs/api/models/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ class Meta:
5151
@property
5252
def _scheduler(self):
5353
mod = importlib.import_module(settings.SCHEDULER_MODULE)
54-
return mod.SchedulerClient(settings.SCHEDULER_URL,
55-
settings.SCHEDULER_AUTH,
56-
settings.SCHEDULER_OPTIONS)
54+
return mod.SchedulerClient(settings.SCHEDULER_URL)
5755

5856

5957
class UuidAuditedModel(AuditedModel):

rootfs/deis/settings.py

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,22 @@
88
import sys
99
import tempfile
1010

11-
12-
PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
13-
11+
# A boolean that turns on/off debug mode.
12+
# https://docs.djangoproject.com/en/1.9/ref/settings/#debug
1413
DEBUG = False
1514

15+
# If set to True, Django's normal exception handling of view functions
16+
# will be suppressed, and exceptions will propagate upwards
17+
# https://docs.djangoproject.com/en/1.9/ref/settings/#debug-propagate-exceptions
18+
DEBUG_PROPAGATE_EXCEPTIONS = False
19+
1620
# Silence two security messages around SSL as router takes care of them
17-
# https://docs.djangoproject.com/es/1.9/ref/checks/#security
21+
# https://docs.djangoproject.com/en/1.9/ref/checks/#security
1822
SILENCED_SYSTEM_CHECKS = [
1923
'security.W004',
2024
'security.W008'
2125
]
2226

23-
ADMINS = (
24-
# ('Your Name', 'your_email@example.com'),
25-
)
26-
27-
MANAGERS = ADMINS
28-
2927
CONN_MAX_AGE = 60 * 3
3028

3129
# SECURITY: change this to allowed fqdn's to prevent host poisioning attacks
@@ -44,7 +42,8 @@
4442

4543
# If you set this to False, Django will make some optimizations so as not
4644
# to load the internationalization machinery.
47-
USE_I18N = True
45+
# https://docs.djangoproject.com/en/1.9/ref/settings/#use-i18n
46+
USE_I18N = False
4847

4948
# If you set this to False, Django will not format dates, numbers and
5049
# calendars according to the current locale.
@@ -53,19 +52,6 @@
5352
# If you set this to False, Django will not use timezone-aware datetimes.
5453
USE_TZ = True
5554

56-
# Absolute filesystem path to the directory that will hold user-uploaded files.
57-
# Example: "/var/www/example.com/media/"
58-
MEDIA_ROOT = ''
59-
60-
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
61-
# trailing slash.
62-
# Examples: "http://example.com/media/", "http://media.example.com/"
63-
MEDIA_URL = ''
64-
65-
# Static files (CSS, JavaScript, Images)
66-
# https://docs.djangoproject.com/en/1.9/howto/static-files/
67-
STATIC_URL = '/static/'
68-
6955
# Manage templates
7056
TEMPLATES = [
7157
{
@@ -276,8 +262,6 @@
276262
# default scheduler settings
277263
SCHEDULER_MODULE = 'scheduler.mock'
278264
SCHEDULER_URL = 'localhost'
279-
SCHEDULER_AUTH = None
280-
SCHEDULER_OPTIONS = None
281265

282266
# security keys and auth tokens
283267
random_secret = 'CHANGEME_sapm$s%upvsw5l_zuy_&29rkywd^78ff(qi*#@&*^'

rootfs/scheduler/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ def unhealthy(status_code):
235235

236236
class KubeHTTPClient(AbstractSchedulerClient):
237237

238-
def __init__(self, target, auth, options):
239-
super(KubeHTTPClient, self).__init__(target, auth, options)
238+
def __init__(self, target):
239+
super(KubeHTTPClient, self).__init__(target)
240240
self.url = settings.SCHEDULER_URL
241241
self.registry = settings.REGISTRY_URL
242242
self.apiversion = "v1"

rootfs/scheduler/abstract.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ class AbstractSchedulerClient(object):
44
A generic interface to a scheduler backend.
55
"""
66

7-
def __init__(self, target, auth, options):
7+
def __init__(self, target):
88
self.target = target
9-
self.auth = auth
10-
self.options = options
119

1210
def create(self, name, image, command, **kwargs):
1311
"""Create a new container."""

0 commit comments

Comments
 (0)