Changeset 6495
- Timestamp:
- Dec 28, 2008, 10:37:48 PM (16 years ago)
- Location:
- trunk/exodus
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/exodus/admin.py
r6491 r6495 37 37 'fields' : ('ssid', 'channel', 'antenna', 'polar', 'mode')}), 38 38 ) 39 class Media: 40 js = ("/static/showandhide.js",) 41 39 42 40 43 advanced_admin.register(Antenna) … … 44 47 advanced_admin.register(Node, NodeAdmin) 45 48 advanced_admin.register(Interface, InterfaceAdmin) 46 #advanced_admin.register(PublicAP)47 49 advanced_admin.register(DhcpStatic) 48 50 … … 53 55 plain_admin.register(Node) 54 56 plain_admin.register(Interface) 55 #plain_admin.register(PublicAP)56 57 plain_admin.register(DhcpStatic) 57 58 … … 62 63 databrowse.site.register(Node) 63 64 databrowse.site.register(Interface) 64 #databrowse.site.register(PublicAP)65 65 databrowse.site.register(DhcpStatic) -
trunk/exodus/forms.py
r6491 r6495 262 262 def clean_ssid(self): 263 263 self.type = self.cleaned_data.get('type') 264 edit = bool(self.instance.pk) 264 265 if not link_is_wireless(self): 265 266 return None 266 267 267 if not edit: 268 return new_ssid 269 270 271 272 -
trunk/exodus/wllogic.py
r6480 r6495 9 9 MANAGED = WIFI_MODE_CHOICES[1][0] 10 10 11 def new_ssid(nic): 11 def new_ssid_for_save_iface(nic): 12 return new_ssid(nic.node, nic.iface, nic.accesspoint, nic.direction) 13 14 def new_ssid(node, iface, accesspoint=False, direction=None): 12 15 """Generates a new ssid name for a new wifi NIC. 13 16 … … 16 19 """ 17 20 18 node = nic.node.name19 network = n ic.node.network.name21 nodename = node.name 22 network = node.network.name 20 23 21 if nic.accesspoint:24 if accesspoint: 22 25 ssid_list = set([i.ssid for i in \ 23 nic.node.interface_set.filter(accesspoint=True)]) 24 ssid = "ap%%d.%s.%s" % ( node, network) 25 free_list = ( ssid % (i) for i in range(len(ssid_list)+1) if not 26 node.interface_set.filter(accesspoint=True)]) 27 ssid = "ap%%s.%s.%s" % ( nodename, network) 28 29 free_list = set() 30 if (ssid % "") not in ssid_list: 31 return (ssid % ("")) 32 33 34 # compensate for the first AP. First AP ssid is: ap.nodename.network 35 # second AP is ap2.nodename.network 36 free_list = ( ssid % (i) for i in range(2, len(ssid_list)+2) if not 26 37 (ssid %(i) in ssid_list)) 27 38 return free_list.next() 28 39 29 40 else: 30 return "il-%s.%s.%s.%s" % (nic.direction, nic.iface, node, network) 31 41 ssid = "%%S.%s.%s" % (nodename, network) 42 if direction: 43 return ssid % (direction) 44 else: 45 return ssid % (iface) 46 32 47 # 33 48 # Taken from lvoege@gmail.com's getrange.py
Note:
See TracChangeset
for help on using the changeset viewer.