Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VR: fix wrong check when compare two configuration files #9822

Open
wants to merge 1 commit into
base: 4.18
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion systemvm/debian/opt/cloud/bin/cs/CsFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,6 @@ def deleteLine(self, search):
self.new_config = list(temp_config)

def compare(self, o):
result = (isinstance(o, self.__class__) and set(self.config) == set(o.config))
result = (isinstance(o, self.__class__) and self.config == o.config)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this means that we no longer compare the set to be equal but the line by line items (in order). Is that really what we want @weizhouapache ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we should compare lines by lines.

the method is being used to compare the configurations for

  • haproxy
  • conntrackd
  • radvd

for all 3, I think the order of configurations in the files matters.

logging.debug("Comparison of CsFiles content is ==> %s" % result)
return result
Loading