Remove topo_rspec attributes if egre_key not present
[nodemanager-topo.git] / create-topo-attributes.py
index 816c819..6d64d99 100755 (executable)
@@ -128,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])
+