Commit 32a74d46 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Avoid calling self.getMissingBusinessTemplateSet() twice.

parent 151a120e
...@@ -152,13 +152,11 @@ class ERP5Updater(object): ...@@ -152,13 +152,11 @@ class ERP5Updater(object):
found_dict = self.getSystemSignatureDict("business_template_dict", {}) found_dict = self.getSystemSignatureDict("business_template_dict", {})
return set(self.business_template_list).difference(found_dict) return set(self.business_template_list).difference(found_dict)
def isBusinessTemplateUpdated(self):
return len(self.getMissingBusinessTemplateSet()) == 0
def updateBusinessTemplateList(self): def updateBusinessTemplateList(self):
""" Update Business Template Configuration, including the repositories """ Update Business Template Configuration, including the repositories
""" """
if not self.isBusinessTemplateUpdated(): missing_business_template_set = self.getMissingBusinessTemplateSet()
if missing_business_template_set:
# Before updating the business templates, it is required to make sure # Before updating the business templates, it is required to make sure
# the repositories are updated, thus update them even if they are # the repositories are updated, thus update them even if they are
# already present because there may be new business templates... # already present because there may be new business templates...
...@@ -168,7 +166,7 @@ class ERP5Updater(object): ...@@ -168,7 +166,7 @@ class ERP5Updater(object):
self._setRepositoryList(repository_list) self._setRepositoryList(repository_list)
# Require to update Business template # Require to update Business template
self._installBusinessTemplateList(list(self.getMissingBusinessTemplateSet())) self._installBusinessTemplateList(list(missing_business_template_set))
return True return True
return False return False
......
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