Commit 85e9a942 authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_config: Compare hash while subtracting 2 Business Manager

parent 3f24ea18
...@@ -331,11 +331,19 @@ class BusinessManager(XMLObject): ...@@ -331,11 +331,19 @@ class BusinessManager(XMLObject):
""" """
Override subtract to find difference b/w the values in different cases. Override subtract to find difference b/w the values in different cases.
""" """
# Create the sha list for all path item list available in current object
sha_list = [item._sha for item in self._path_item_list]
# Reverse the sign of Business Item objects for the old Business Manager # Reverse the sign of Business Item objects for the old Business Manager
# Trying comparing/subtracting ZODB with old installed object # Trying comparing/subtracting ZODB with old installed object
for path_item in other._path_item_list: for path_item in other._path_item_list:
if path_item._sha in sha_list:
self._path_item_list = [item for item
in self._path_item_list
if item._sha != path_item._sha]
else:
path_item._sign = -1 path_item._sign = -1
self._path_item_list.append(path_item) self._path_item_list.append(path_item)
return self return self
__rsub__ = __add__ __rsub__ = __add__
......
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