~patrick-hetu/+junk/python-django-mysql-support

« back to all changes in this revision

Viewing changes to hooks/wsgi-relation-joined

  • Committer: Bruno Girin
  • Date: 2013-01-28 20:21:00 UTC
  • mfrom: (21.1.2 username-password)
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: brunogirin@gmail.com-20130128202100-k9edsomgfy21pboh
Merged username-password branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
relation-set working_dir="/srv/${UNIT_NAME}/"
7
7
 
8
 
# The best would be to set all variables that starts with wsgi_
9
 
relation-set wsgi_file="wsgi"
10
 
relation-set wsgi_worker_class=$(config-get wsgi_worker_class)
 
8
variables="wsgi_wsgi_file wsgi_workers wsgi_worker_class wsgi_worker_connections wsgi_max_requests wsgi_timeout wsgi_backlog wsgi_keep_alive wsgi_extra wsgi_user wsgi_group wsgi_umask wsgi_log_file wsgi_log_level wsgi_access_logfile wsgi_access_logformat env_extra django_settings python_path port"
 
9
 
 
10
declare -A VAR
 
11
for v in $variables;do
 
12
  VAR[$v]=$(config-get $v)
 
13
  if [ ! -z "${VAR[$v]}" ] ; then
 
14
    relation-set "$v=${VAR[$v]}"
 
15
  fi
 
16
done
 
17
 
 
18
juju-log "Set relation variables: ${VAR[@]}"
11
19