From 2b18fd6de5475f7b818866169c028dc9b80dbbb2 Mon Sep 17 00:00:00 2001 From: Stephen Soltesz Date: Tue, 4 Mar 2008 19:26:17 +0000 Subject: [PATCH] Added code to reduce duplicate entries in /etc/vsys.conf; this will help play more nicely with vsys. --- vsys.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vsys.py b/vsys.py index 22dd5ed..da79b92 100644 --- 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']) -- 2.47.0