[node-patches] Change in ovirt-node[ovirt-3.5]: Config.exists: fix exists method

fabiand at redhat.com fabiand at redhat.com
Wed Aug 12 08:45:25 UTC 2015


Fabian Deutsch has posted comments on this change.

Change subject: Config.exists: fix exists method
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

https://gerrit.ovirt.org/#/c/44727/2//COMMIT_MSG
Commit Message:

Line 9: The exists method is used by the persist script
Line 10: to check if the file that will be persisted
Line 11: exists. However, in commit 9a1986a8 we moved
Line 12: from ovirtfunctions.ovirt_store approach and missed
Line 13: to update the exists method.
I don't see the exists() method in ovirtfunctions.

Why is the new semantiocs of the exists() function needed?
Line 14: 
Line 15: Change-Id: If1ba23d67516f1690b223e3dd43985e5d9a502ef
Line 16: Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1251867


https://gerrit.ovirt.org/#/c/44727/2/src/ovirt/node/utils/fs/__init__.py
File src/ovirt/node/utils/fs/__init__.py:

Line 676:         if filename and self.is_enabled():
Line 677:             from ovirtnode import ovirtfunctions
Line 678:             return ovirtfunctions.ovirt_safe_delete_config(filename)
Line 679: 
Line 680:     def exists(self, filename):
This change can not be made, because we change the semantics of exists() - we basically break the API.

We can either add a new function or add an argument to this one to enable a strict mode i.e.:

def exists(self, filename, compare_contents=False)
Line 681:         """Check if the given file is persisted
Line 682:         """
Line 683:         persisted_path = self._config_path(filename)
Line 684: 


-- 
To view, visit https://gerrit.ovirt.org/44727
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If1ba23d67516f1690b223e3dd43985e5d9a502ef
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-node
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes



More information about the node-patches mailing list