Commit 2b265d1d authored by Ayush Tiwari's avatar Ayush Tiwari Committed by Ayush Tiwari

bt5_config: Add function for installing Multiple Business Manger

parent 7194af6e
...@@ -1651,11 +1651,11 @@ class TemplateTool (BaseTool): ...@@ -1651,11 +1651,11 @@ class TemplateTool (BaseTool):
else: else:
# Summation should also consider arithmetic on the Business Item(s) # Summation should also consider arithmetic on the Business Item(s)
# having same path and layer and combine them. # having same path and layer and combine them.
combinedBM = sum(bm_list) combinedBM = reduce(lambda x, y: x+y, bm_list)
# XXX: We are missing the part of creating installed_BM for all the BM # XXX: We are missing the part of creating installed_BM for all the BM
# we have in bm_list, because this would be needed in case we build # we have in bm_list, because this would be needed in case we build
# Business Manager again # Business Manager again.
# Reduce the final Business Manager # Reduce the final Business Manager
combinedBM.reduceBusinessManager() combinedBM.reduceBusinessManager()
...@@ -1664,8 +1664,8 @@ class TemplateTool (BaseTool): ...@@ -1664,8 +1664,8 @@ class TemplateTool (BaseTool):
return combinedBM return combinedBM
security.declareProtected(Permissions.ManagePortal, security.declareProtected(Permissions.ManagePortal,
'installMultipleBusinessManager') 'installBusinessManager')
def installMultipleBusinessManager(self, bm): def installBusinessManager(self, bm):
""" """
Run installation on flattened Business Manager Run installation on flattened Business Manager
""" """
...@@ -1676,6 +1676,16 @@ class TemplateTool (BaseTool): ...@@ -1676,6 +1676,16 @@ class TemplateTool (BaseTool):
else: else:
raise ValueError, 'Business Manager not flattened, cannot install' raise ValueError, 'Business Manager not flattened, cannot install'
security.declareProtected(Permissions.ManagePortal,
'installMultipleBusinessManager')
def installMultipleBusinessManager(self, bm_list):
"""
Run installation on flattened Business Manager
"""
combinedBM = self.combineMultipleBusinessManager(bm_list)
self.installBusinessManager(combinedBM)
security.declareProtected(Permissions.ManagePortal, security.declareProtected(Permissions.ManagePortal,
'getBusinessTemplateUrl') 'getBusinessTemplateUrl')
def getBusinessTemplateUrl(self, base_url_list, bt5_title): def getBusinessTemplateUrl(self, base_url_list, bt5_title):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment