Remove topo_rspec attributes if egre_key not present
[nodemanager-topo.git] / create-topo-attributes.py
index 380a147..6d64d99 100755 (executable)
@@ -114,11 +114,10 @@ for slice in GetSlices():
         """
         for node in slicenodes:
             topo = []
-            site = get_site(node)
-            for adj in adjacencies[site]:
+            for adj in adjacencies[get_site(node)]:
                 for adj_node in get_sitenodes(adj):
                     if node != adj_node and adj_node in slicenodes:
-                        link = adj_node, get_ipaddr(adj_node)
+                        link = adj_node, get_ipaddr(adj_node), "1Mbit"
                         topo.append(link)
             topo_str = "%s" % topo
             print node, topo_str
@@ -129,9 +128,10 @@ for slice in GetSlices():
                 id = slice['slice_id']
                 AddSliceAttribute(id, 'topo_rspec', topo_str, node)
 
-        """ Remove old topo_rspec entries """
-        for node in topo_attr:
-            DeleteSliceAttribute(topo_attr[node])
-
     else:
         print "No EGRE key for %s" % slice['name']
+
+    """ Remove old topo_rspec entries """
+    for node in topo_attr:
+        DeleteSliceAttribute(topo_attr[node])
+