Rename LOCALSERVER -> LOCAL_SERVER.

(imported from commit b3abdd10d54d2ad7a9c463af9a291d2e2127707f)
This commit is contained in:
Waseem Daher 2013-10-25 17:34:27 -04:00
parent 8e21d70afe
commit 66f48288b4
7 changed files with 17 additions and 17 deletions

View File

@ -6,7 +6,7 @@ import ujson
def add_settings(request):
return {
'full_navbar': settings.FULL_NAVBAR,
'localserver': settings.LOCALSERVER,
'local_server': settings.LOCAL_SERVER,
}
def add_metrics(request):

View File

@ -121,7 +121,7 @@ class Command(BaseCommand):
for realm in Realm.objects.all():
realms[realm.domain] = realm
if not settings.LOCALSERVER:
if not settings.LOCAL_SERVER:
# Associate initial deployment with Realm
dep = Deployment.objects.all()[0]
dep.realms = [realms["zulip.com"]]

View File

@ -324,7 +324,7 @@ class Stream(models.Model):
# historical messages for all streams that are not invite-only.
return ((not settings.DEPLOYED or self.realm.domain in
["zulip.com"] or self.realm.id > 68
or settings.LOCALSERVER)
or settings.LOCAL_SERVER)
and not self.invite_only)
class Meta:

View File

@ -24,7 +24,7 @@ class Migration(SchemaMigration):
))
db.create_unique(u'zilencer_deployment_realms', ['deployment_id', 'realm_id'])
if not settings.LOCALSERVER:
if not settings.LOCAL_SERVER:
try:
dep = orm['zilencer.Deployment']()
dep.api_key = settings.DEPLOYMENT_ROLE_KEY

View File

@ -46,13 +46,13 @@ EMAIL_HOST_PASSWORD = 'xxxxxxxxxxxxxxxx'
EMAIL_PORT = 587
# Whether we're running in a production environment. Note that DEPLOYED does
# **not** mean hosted by us; customer sites are DEPLOYED and LOCALSERVER
# **not** mean hosted by us; customer sites are DEPLOYED and LOCAL_SERVER
# and as such should not for example assume they are the main Zulip site.
DEPLOYED = os.path.exists('/etc/humbug-server')
STAGING_DEPLOYED = (platform.node() == 'staging.zulip.net')
TESTING_DEPLOYED = not not re.match(r'^test', platform.node())
LOCALSERVER = os.path.exists('/etc/zulip-local')
LOCAL_SERVER = os.path.exists('/etc/zulip-local')
if TESTING_DEPLOYED:
EXTERNAL_HOST = platform.node()
@ -70,8 +70,8 @@ if DEPLOYED:
else:
FEEDBACK_TARGET="http://localhost:9991/api"
# For now, LOCALSERVER is only testing, so write to our test buckets
if DEPLOYED and not LOCALSERVER:
# For now, LOCAL_SERVER is only testing, so write to our test buckets
if DEPLOYED and not LOCAL_SERVER:
S3_KEY="xxxxxxxxxxxxxxxxxxxx"
S3_SECRET_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
S3_BUCKET="humbug-user-uploads"
@ -96,7 +96,7 @@ if STAGING_DEPLOYED or TESTING_DEPLOYED:
TWITTER_CONSUMER_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
TWITTER_ACCESS_TOKEN_KEY = "xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
TWITTER_ACCESS_TOKEN_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
elif DEPLOYED and not LOCALSERVER:
elif DEPLOYED and not LOCAL_SERVER:
# This is the real set of API credentials used by our real server,
# and we probably shouldn't test with it just so we don't waste its requests
# Application: "Humbug HQ - Production"

View File

@ -11,13 +11,13 @@ import sys
from zerver.openid import openid_failure_handler
# Whether we're running in a production environment. Note that DEPLOYED does
# **not** mean hosted by us; customer sites are DEPLOYED and LOCALSERVER
# **not** mean hosted by us; customer sites are DEPLOYED and LOCAL_SERVER
# and as such should not for example assume they are the main Zulip site.
DEPLOYED = os.path.exists('/etc/humbug-server')
STAGING_DEPLOYED = (platform.node() == 'staging.zulip.net')
TESTING_DEPLOYED = not not re.match(r'^test', platform.node())
LOCALSERVER = os.path.exists('/etc/zulip-local')
LOCAL_SERVER = os.path.exists('/etc/zulip-local')
# TODO: Clean this up
if TESTING_DEPLOYED:
@ -42,8 +42,8 @@ TEST_SUITE = False
if DEBUG:
INTERNAL_IPS = ('127.0.0.1',)
if TESTING_DEPLOYED or LOCALSERVER:
# XXX we should probably tighten this for LOCALSERVER
if TESTING_DEPLOYED or LOCAL_SERVER:
# XXX we should probably tighten this for LOCAL_SERVER
# Allow any hosts for our test instances, to reduce 500 spam
ALLOWED_HOSTS = ['*']
elif DEPLOYED:
@ -73,7 +73,7 @@ DATABASES = {"default": {
},
}
if not DEPLOYED or LOCALSERVER:
if not DEPLOYED or LOCAL_SERVER:
DATABASES["default"].update({
'PASSWORD': LOCAL_DATABASE_PASSWORD,
'HOST': 'localhost',
@ -187,7 +187,7 @@ INSTALLED_APPS = (
)
LOCAL_STATSD = (False)
USING_STATSD = (DEPLOYED and not TESTING_DEPLOYED and not LOCALSERVER) or LOCAL_STATSD
USING_STATSD = (DEPLOYED and not TESTING_DEPLOYED and not LOCAL_SERVER) or LOCAL_STATSD
# These must be named STATSD_PREFIX for the statsd module
# to pick them up
@ -272,7 +272,7 @@ else:
STATICFILES_FINDERS = (
'zerver.finders.ZulipFinder',
)
if DEPLOYED or LOCALSERVER:
if DEPLOYED or LOCAL_SERVER:
STATIC_ROOT = '/home/zulip/prod-static'
else:
STATIC_ROOT = 'prod-static/serve'

View File

@ -214,7 +214,7 @@ v1_api_and_json_patterns = patterns('zerver.views',
url(r'^events$', 'rest_dispatch',
{'GET': 'get_events_backend'}),
)
if not settings.LOCALSERVER:
if not settings.LOCAL_SERVER:
v1_api_and_json_patterns += patterns('',
# Still scoped to api/v1/, but under a different project
url(r'^deployments/', include('zilencer.urls.api')),