Added code to reduce duplicate entries in /etc/vsys.conf; this will help play
authorStephen Soltesz <soltesz@cs.princeton.edu>
Tue, 4 Mar 2008 19:26:17 +0000 (19:26 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Tue, 4 Mar 2008 19:26:17 +0000 (19:26 +0000)
more nicely with vsys.

vsys.py

diff --git a/vsys.py b/vsys.py
index 22dd5ed..da79b92 100644 (file)
--- a/vsys.py
+++ b/vsys.py
@@ -27,10 +27,11 @@ def GetSlivers(data):
     for sliver in data['slivers']:
         for attribute in sliver['attributes']:
             if attribute['name'] == 'vsys':
-                # add to conf
-                slices.append(sliver['name'])
-                # As the name implies, when we find an attribute, we
-                createVsysDir(sliver['name'])
+                if sliver['name'] not in slices:
+                    # add to conf
+                    slices.append(sliver['name'])
+                    # As the name implies, when we find an attribute, we
+                    createVsysDir(sliver['name'])
                 # add it to our list of slivers that need vsys
                 if attribute['value'] in scripts.keys():
                     scripts[attribute['value']].append(sliver['name'])