From 095f66928fef2e2c402a5863b4c3eb2c8ad363e0 Mon Sep 17 00:00:00 2001 From: Marc Fiuczynski Date: Sat, 30 Jan 2010 04:42:17 +0000 Subject: [PATCH] more graceful log message when GetSlivers() API called failed --- plugins/vsys.py | 5 +++++ plugins/vsys_privs.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/plugins/vsys.py b/plugins/vsys.py index 05b87cd..f1abfd9 100644 --- a/plugins/vsys.py +++ b/plugins/vsys.py @@ -15,6 +15,11 @@ def start(options, conf): def GetSlivers(data, config=None, plc=None): """For each sliver with the vsys attribute, set the script ACL, create the vsys directory in the slice, and restart vsys.""" + + if 'slivers' not in data: + logger.log("vsys: getslivers data lack's sliver information. IGNORING!") + return + # Touch ACLs and create dict of available scripts = {} for script in touchAcls(): scripts[script] = [] diff --git a/plugins/vsys_privs.py b/plugins/vsys_privs.py index 5cd40a2..e6d8754 100755 --- a/plugins/vsys_privs.py +++ b/plugins/vsys_privs.py @@ -20,6 +20,12 @@ def start(options, conf): logger.log("Created vsys attributes dir") def GetSlivers(data, config=None, plc=None): + + if 'slivers' not in data: + logger.log("vsys_privs: getslivers data lack's sliver information. IGNORING!") + return + + privs = {} # Parse attributes and update dict of scripts -- 2.43.0