Changeset 6210
- Timestamp:
- Aug 16, 2008, 1:54:46 AM (16 years ago)
- Location:
- exodus
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
exodus/sql/mode.sql
r6190 r6210 1 INSERT INTO exodus_mode VALUES ( 1, 'managed'); 2 INSERT INTO exodus_mode VALUES ( 2, 'ad-hoc'); 3 INSERT INTO exodus_mode VALUES ( 3, 'master'); 1 INSERT INTO exodus_mode VALUES ( 1, 'master'); 2 INSERT INTO exodus_mode VALUES ( 2, 'managed'); -
exodus/templates/node-detail.html
r6208 r6210 5 5 6 6 <div> 7 8 Location: {{ object.location.description }} <br>9 X: {{ object.location.coordinateX}} <br>10 Y: {{ object.location.coordinateY}} <br>7 <h3> Location </h3> 8 Description: {{ object.location.description }} <br> 9 Longitude: {{ object.location.longitude }} <br> 10 Latitude: {{ object.location.latitude }} <br> 11 11 12 12 Master ip: {{ object.masterip }} -
exodus/views.py
r6206 r6210 9 9 10 10 from exodus.models import * 11 from exodus.wllogic import freemasterip, new ssidname11 from exodus.wllogic import freemasterip, newSSIDName 12 12 13 13 class AddLocationForm(forms.ModelForm): … … 54 54 instance = form.save(commit=False) 55 55 if str(instance.type) != "eth": 56 print instance.iface 57 # instance.ssid = newssidname(instance.node.name, 58 # instance.iface) 56 instance.ssid = newSSIDName(instance.node, instance.iface, 'unused') 59 57 instance.channel = '1' 60 58 instance.mode = Mode(pk=1) # set to master … … 76 74 instance = form.save(commit=False) 77 75 if str(instance.iface1.type) != "eth": 78 print instance.iface 79 instance.ssid = newssidname(instance.node.name, 80 instance.iface) 76 instance.ssid = newSSIDName(instance.node, 77 instance.iface,'il') 81 78 instance.channel = '1' 82 79 instance.mode = Mode(pk=1) # set to master … … 97 94 form = addOmniForm(request.POST) 98 95 if form.is_valid(): 99 instance = form.save(commit=False) 96 instance = form.save(commit=False) 97 instance.ssid = newSSIDName(instance.iface.node, instance.iface, 'omni') 100 98 instance.save() 101 99 return HttpResponseRedirect("/exodus/") -
exodus/wllogic.py
r6191 r6210 3 3 from exodus.models import Node, Network 4 4 5 def new ssidname(node,desc):5 def newSSIDName(node, nic, desc): 6 6 """Generates a new ssid name for a new wifi NIC""" 7 7 8 return "%s.%s.%s" % (desc, Node.objects.get(pk=node).name, 9 Node.objects.get(pk=node).network.domainname) 8 return "%s-%s.%s.%s" % (desc, nic.iface, node.name, node.network.domainname) 10 9 11 def newname(test):12 return "%s.%s.%s" % ( test, test, test )13 10 # 14 11 # Taken from lvoege@gmail.com's getrange.py
Note:
See TracChangeset
for help on using the changeset viewer.