Fix case where topo_rspec is null
[nodemanager-topo.git] / topo.py
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'])