Changeset 6231 for exodus/views.py


Ignore:
Timestamp:
Aug 23, 2008, 12:44:18 PM (16 years ago)
Author:
roland
Message:

added basic addinterlink functionality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • exodus/views.py

    r6230 r6231  
    99
    1010from exodus.models import *
    11 from exodus.wllogic import freemasterip, newSSIDName
     11from exodus.wllogic import freemasterip, newSSIDName, freeinterlinkip
    1212
    1313class AddLocationForm(forms.ModelForm):
     
    8383                                        print '''these ifaces are of the same type'''
    8484                                        instance.same=True
    85                                         print instance.same
    86 
    87                                 if str(instance.iface1.type) == '11b' or str(instance.iface1.type) == '11g':
    88                                         print '''it's 11b or g'''
    89 
    90                                 #if (instance.iface1.type == '11b' | instance.iface2.type == '11b' )  &
    91                                 #               (instance.iface1.type == '11g' || instance.iface2.type == '11g'):
    92                                 #               print '''11b and 11g are compatible'''
     85                                if str(instance.iface1.type) == '11b' and str(instance.iface2.type) == '11g':
     86                                        instance.same=True
     87                                        print '11b + 11g'
     88                                if str(instance.iface1.type) == '11g' and str(instance.iface2.type) == '11b':
     89                                        instance.same=True
     90                                        print '11g + 11b'
     91                                #Generate IP addresses
     92                                if instance.same == True:
     93                                        instance.ip1,instance.ip2 = freeinterlinkip()
     94                                        netmask = '30'
     95                                        instance.save()
     96                                       
    9397                        #if wifi: check master and managed states for existings NICs/Interlinks
    9498                                #Generate SSID
     99                        # add descriptions
    95100                        #Generate ips and netmask
    96101                        #Save form
Note: See TracChangeset for help on using the changeset viewer.