From 12587297bc7816108884cb3f45b2ab23bbff13a2 Mon Sep 17 00:00:00 2001
From: Andy Bavier <acb@cs.princeton.edu>
Date: Wed, 15 Jul 2009 18:19:30 +0000
Subject: [PATCH] Fix case where topo_rspec is null

---
 NodeManager-topo.spec | 2 +-
 topo.py               | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/NodeManager-topo.spec b/NodeManager-topo.spec
index a04871e..040edad 100644
--- a/NodeManager-topo.spec
+++ b/NodeManager-topo.spec
@@ -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
--- 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'])
-- 
2.47.0