From 7bbc207a98ee2ba56fa91feb8b7105c7daca55bf Mon Sep 17 00:00:00 2001
From: Wainer Vandelli <Wainer.Vandelli@cern.ch>
Date: Fri, 16 Dec 2011 14:54:43 +0000
Subject: [PATCH] Allow init parameters for backend module

---
 Script/Conf.cfg |  3 +++
 Script/Conf.py  | 17 +++++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/Script/Conf.cfg b/Script/Conf.cfg
index 58ee4b7..9ca7f4d 100755
--- a/Script/Conf.cfg
+++ b/Script/Conf.cfg
@@ -57,6 +57,9 @@ Filenameparser: 'SFOFileNameParser'
 # Module provide backend access functions
 BackendModule: 'castorstorage'
 
+# Backend specific parameters
+BackendModuleConf: {}
+
 
 #[Manager]
 ########## MANAGER THREAD ##########
diff --git a/Script/Conf.py b/Script/Conf.py
index e4cc61a..b86a890 100755
--- a/Script/Conf.py
+++ b/Script/Conf.py
@@ -5,16 +5,10 @@ __version__='$Revision$'
 
 
 from config import Config
+from collections import namedtuple
 
-class DrivenPool:
 
-    def __init__(self, list):
-        self.projecttag = list[0]
-        self.streamtype = list[1]
-        self.streamname = list[2]
-        self.pool = list[3]
-        self.targetdir = list[4]
-        self.stagehost = list[5]
+DrivenPool = namedtuple('Point', ['projecttag','streamtype','streamname','pool','targetdir','stagehost'])
 
 class Conf:
     
@@ -84,6 +78,13 @@ class Conf:
         except AttributeError:
             self.backend = __import__('castorstorage', globals(), locals())
 
+        #Backend params
+        try:
+            self.backend.init(cfg.BackendModuleConf)
+        except AttributeError:
+            pass
+
+
         ########## MANAGER THREAD ##########
 
         # Directory List where to get Data Files (list of strings)
-- 
GitLab