Changeset 10375 in genesis for tools/make-network-kml.py


Ignore:
Timestamp:
Apr 7, 2012, 11:31:53 AM (13 years ago)
Author:
rick
Message:

long v.s. lat v.s. order = weird....

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/make-network-kml.py

    r10037 r10375  
    1515OUTFILE = os.path.join(os.getcwd(),'network.kml')
    1616
    17 store = yaml.load(open('store.yaml','r'))
     17try:
     18  store = yaml.load(open('store.yaml','r'))
     19except IOError:
     20  store = None
    1821
    1922
     
    2831    <description>%(nodename)s</description>
    2932    <Point>
    30       <coordinates>%(latitude)s,%(longitude)s,0</coordinates>
     33      <coordinates>%(longitude)s,%(latitude)s,0</coordinates>
    3134    </Point>
    3235  </Placemark>
     
    3740      <LineString>
    3841        <coordinates>
    39           %(latitudeA)s,%(longitudeA)s,0
    40           %(latitudeB)s,%(longitudeB)s,0
     42          %(longitudeA)s,%(latitudeA)s,0
     43          %(longitudeB)s,%(latitudeB)s,0
    4144        </coordinates>
    4245      </LineString>
     
    8689          nodename = datadump['nodename']
    8790          INTERVAL = 60 * 10
    88           if store['uptime'].has_key(nodename) and store['snmp'].has_key(nodename) and store['traffic'].has_key(nodename):
    89             if store['traffic'][nodename].has_key(iface):
     91          if store and store['uptime'].has_key(nodename) and store['snmp'].has_key(nodename) and store['traffic'].has_key(nodename):
     92            if store and store['traffic'][nodename].has_key(iface):
    9093              (b_in, b_out) = store['traffic'][nodename][iface]
    9194              uptime = store['uptime'][nodename]
Note: See TracChangeset for help on using the changeset viewer.