modified settings.py and wsgi.py

This commit is contained in:
Vladimir Kozhukalov 2012-06-15 20:44:14 +04:00
parent 3ed2364843
commit 191ba58c6b
6 changed files with 55 additions and 37 deletions

View File

@ -0,0 +1,26 @@
define :ssh_keygen, :length => 2048 do
homedir = params[:homedir]
username = params[:username]
groupname = params[:groupname]
keytype = params[:keytype]
if not keytype =~ /^(rsa|dsa)$/
raise Chef::Exceptions::ConfigurationError, "Wrong keytype parameter: #{keytype}"
end
directory homedir do
owner username
group groupname
mode '755'
recursive true
end
execute "Generate ssh key for #{username}" do
command "ssh-keygen -t #{keytype} -b #{params[:length]} -N '' -f #{homedir}/.ssh/id_#{keytype}"
creates File.join(homedir, ".ssh", "id_#{keytype}")
user username
group groupname
end
end

View File

@ -0,0 +1,23 @@
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters':{
'simple':{
'format': '%(asctime)s - %(name)s - %(levelname)s - %(message)s',
},
},
'handlers': {
'file': {
'class': 'logging.FileHandler',
'filename': '<%= @filename %>',
'formatter': 'simple',
},
},
'root':{
'level': '<%= @level %>',
'handlers': ['file'],
},
}
PATH_TO_SSH_KEY = "<%= @sshkey %>"

View File

View File

@ -131,34 +131,7 @@ INSTALLED_APPS = (
TEST_RUNNER = 'nailgun.testrunner.MyRunner'
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
import nailgun.extrasettings
# Celery settings
import djcelery
@ -173,6 +146,5 @@ CELERY_EAGER_PROPAGATES_EXCEPTIONS = False
CHEF_CONF_FOLDER = "/var/www"
CHEF_NODES_DATABAG_NAME = "nodes"
PATH_TO_SSH_KEY = os.path.join(os.getenv("HOME"), ".ssh/id_rsa")
PISTON_IGNORE_DUPE_MODELS = True

View File

@ -13,16 +13,14 @@ middleware here, or combine a Django application with an application of another
framework.
"""
import nailgun.venv
import os
import sys
import site
from nailgun.venv import VENV
if nailgun.venv.VENV:
if VENV:
prev_sys_path = list(sys.path)
site.addsitedir(nailgun.venv.VENV)
site.addsitedir(VENV)
new_sys_path = []
for item in list(sys.path):
@ -32,8 +30,6 @@ if nailgun.venv.VENV:
sys.path[:0] = new_sys_path
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "nailgun.settings")
import monitor

View File

@ -19,3 +19,4 @@ redis-server
python-pip
python-paramiko
python-virtualenv
python-dev