Changeset 074912e
- Timestamp:
- 05/25/11 23:15:39 (2 years ago)
- Branches:
- master
- Children:
- c6075f0
- Parents:
- 18798af (diff), ac3bc8a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - git-author:
- Tomas Edwardsson <tommi@…> (05/25/11 23:15:39)
- git-committer:
- Tomas Edwardsson <tommi@…> (05/25/11 23:15:39)
- Location:
- adagios
- Files:
-
- 2 added
- 3 edited
-
README (added)
-
configurator/okconfig/__init__.py (added)
-
configurator/views.py (modified) (3 diffs)
-
settings.py (modified) (2 diffs)
-
urls.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
adagios/configurator/views.py
rfa5f57a r18798af 1 from django.shortcuts import render_to_response 2 1 from django.shortcuts import render_to_response, redirect 2 from django.core import serializers 3 from django.http import HttpResponse, HttpResponseServerError 4 from django.utils import simplejson 3 5 4 6 from doit import * … … 6 8 def test(request): 7 9 return index(request) 10 11 def home(request): 12 return redirect('adagios') 13 8 14 def index(request): 9 15 parse() … … 102 108 103 109 110 def api_host(request, host_name=None, ext='xml'): 111 parse() 112 c = {} 113 c['hosts'] = get_hosts() 114 115 116 if host_name != None: 117 c['host'] = get_host( host_name ) 118 data = '' 119 if ext == 'xml': 120 import xml.marshal.generic 121 data = xml.marshal.generic.dumps(c['host']) 122 elif ext == 'html': 123 return render_to_response('configuration/api/host.html', c) 124 elif ext == 'json': 125 import json 126 data = json.dumps(c['host']) 127 else: 128 return HttpResponseServerError("fle") 129 return HttpResponse(data, mimetype='application/javascript') 130 131 return NotImplementedError 132 133 def api_dnslookup(request, host_name=None): 134 import socket 135 136 raise NotImplementedError 104 137 105 138 106 139 107 -
adagios/settings.py
rfa5f57a r8290820 3 3 DEBUG = True 4 4 TEMPLATE_DEBUG = DEBUG 5 6 # Hack to allow relative template paths 7 import os 8 djangopath = os.path.abspath('.') 5 9 6 10 ADMINS = ( … … 82 86 # Always use forward slashes, even on Windows. 83 87 # Don't forget to use absolute paths, not relative paths. 84 '/opt/adagios/templates/',88 "%s/templates" % (djangopath), 85 89 ) 86 90 -
adagios/urls.py
rfa5f57a r18798af 7 7 urlpatterns = patterns('', 8 8 # Example: 9 (r'^adagios/$', 'configurator.views.index'), 10 (r'^adagios/configurator$', 'configurator.views.index'), 9 (r'^$', 'configurator.views.home'), 10 (r'^adagios/api/host/(?P<host_name>.*)\.(?P<ext>.+)$', 'configurator.views.api_host'), 11 (r'^adagios/$', 'configurator.views.index'), 12 (r'^adagios/configurator$', 'configurator.views.index'), 11 13 (r'^adagios/configurator/host$', 'configurator.views.test'), 12 14 (r'^adagios/configurator/host/(?P<host_name>.+)/(?P<service_description>.+)/(?P<field_name>.+)=(?P<new_value>.+)$', 'configurator.views.edit_service'),
Note: See TracChangeset
for help on using the changeset viewer.
