Changeset 6487


Ignore:
Timestamp:
Dec 28, 2008, 1:16:26 AM (16 years ago)
Author:
roland
Message:

Updated comments for Andrea in genesis_to_exodus.

Location:
trunk/exodus/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/exodus/scripts/README

    r6486 r6487  
    1414
    1515$ cd $EXODUSROOT
    16 $ ./bin/django runscript genesis_to_exodus /PATH/TO/py.conf
     16$ ./bin/django runscript genesis_to_exodus --verbosity=2 --traceback /PATH/TO/py.conf
  • trunk/exodus/scripts/genesis_to_exodus.py

    r6486 r6487  
    1919            'latitude': location['lat'], 'longitude': location['lon'] })
    2020        if not loc.is_valid():
    21             print location._errors
     21            for i in loc.errors.keys():
     22                print loc.errors[i][0]
    2223            return None
    2324        locmodel = loc.save()
    24         print 'Location ' + location['descr'] + 'created'
     25        print 'Location ' + location['descr'] + ' created'
    2526    return locmodel.id
    2627
     
    3839            print 'Node '+node['name']+' created'
    3940        else:
    40             print form._errors
     41            for i in form.errors.keys():
     42                print form.errors[i][0]
    4143            return None
    4244    return nodemodel.id
     
    5658        print 'Can\'t import interface '+interface['iface']
    5759        # XXX - outputs html but this is supposed to be a console script
    58         print form._errors
     60        #       fixed output to text.
     61        for i in form.errors.keys():
     62            print form.errors[i][0]
    5963        return None
    6064    return intfmodel.id
     
    137141                            # XXX: The genesis data is complete, the type of
    138142                            #      antenna needs to be passed on.
    139                             #      it's probably better
     143                            #      it's probably better to define the types
     144                            #      beforehand.
    140145
    141146                            # handle Antenna
     
    148153
    149154                            # handle wifi links
     155                            dhcp = config.get(cfgsection, 'dhcp')
     156                            if dhcp != 'no':
     157                                interface['accesspoint'] = True
    150158                            if config.has_option(cfgsection, 'ssid'):
    151159                                ssid = interface['ssid']
     
    154162                                if interface['mode'] == 'ms':
    155163                                    #XXX: if dhcp != 'no' accesspoint = 1
    156                                     interface['accesspoint'] = 1
     164                                    # fixed this above.
     165                                    #interface['accesspoint'] = 1
    157166                                    networks[ssid]['master'] = import_interface(interface)
    158167                                else:
    159                                     networks[ssid]['links'].append(interface);
     168                                    networks[ssid]['links'].append(interface)
    160169                            else:
    161170                                # XXX - should we handle links on not-wifi
     
    163172                                # XXX: yes we should
    164173                                import_interface(interface)
     174                                pass
     175
    165176
    166177    # now we have already created all nodes and master interfaces...
     
    173184    #       trying to update interfaces progressively
    174185
    175     # XXX:this needn't be done, because exodus defines the ssid.
     186    # XXX: my initial thought was that you defined the ssid here, but
     187    #      you use it to determine who is the master and this seems to work
     188    #      well.
    176189    for ssid in networks:
    177190        for interface in networks[ssid]['links']:
Note: See TracChangeset for help on using the changeset viewer.