Douglas Schilling Landgraf has uploaded a new change for review. Change subject: fs/__init__.py: check if it's a file before chksum ......................................................................
fs/__init__.py: check if it's a file before chksum Make sure before doing the cksum validation, it's a file, not a dir. Change-Id: I8a50dca7521336a9feafbc6c03fa38e1a57a6ba9 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1311370 Signed-off-by: Douglas Schilling Landgraf <[email protected]> --- M src/ovirt/node/utils/fs/__init__.py 1 file changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/91/59091/1 diff --git a/src/ovirt/node/utils/fs/__init__.py b/src/ovirt/node/utils/fs/__init__.py index dcf312c..d7e5960 100644 --- a/src/ovirt/node/utils/fs/__init__.py +++ b/src/ovirt/node/utils/fs/__init__.py @@ -689,12 +689,13 @@ not os.path.exists(filename): return False - current_checksum = self.cksum(filename) - stored_checksum = self.cksum(persisted_path) - if stored_checksum == current_checksum: - return True + if os.path.isfile(filename): + current_checksum = self.cksum(filename) + stored_checksum = self.cksum(persisted_path) + if stored_checksum != current_checksum: + return False - return False + return True def is_enabled(self): return File("/proc").exists() and is_bind_mount(self.basedir) -- To view, visit https://gerrit.ovirt.org/59091 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8a50dca7521336a9feafbc6c03fa38e1a57a6ba9 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-node Gerrit-Branch: ovirt-3.6 Gerrit-Owner: Douglas Schilling Landgraf <[email protected]> _______________________________________________ node-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/node-patches
