Fix case where topo_rspec is null
authorAndy Bavier <acb@cs.princeton.edu>
Wed, 15 Jul 2009 18:19:30 +0000 (18:19 +0000)
committerAndy Bavier <acb@cs.princeton.edu>
Wed, 15 Jul 2009 18:19:30 +0000 (18:19 +0000)
NodeManager-topo.spec
topo.py

index a04871e..040edad 100644 (file)
@@ -2,7 +2,7 @@
 
 Name:          NodeManager-topo
 Version:       0.5
-Release:       3
+Release:       4
 Summary:       Plugin supporting creating a default virtual topology.
 
 Group:         System Environment/Daemons
diff --git a/topo.py b/topo.py
index 3bda6bb..b2cabb8 100755 (executable)
--- a/topo.py
+++ b/topo.py
@@ -286,6 +286,7 @@ def write_ospf(filename, myname, ifaces):
     f = open(filename, 'w')
     password = "zebra"
     write_header(f, myname, password)
+    name = None
 
     for name in ifaces:
         f.write ("""!
@@ -296,7 +297,8 @@ def write_ospf(filename, myname, ifaces):
      ip ospf network non-broadcast
 """ % name)
 
-    f.write ("""!
+    if name:
+        f.write ("""!
      router ospf
      ospf router-id %s
 """ % ifaces[name]['local-ip'])