[node-patches] Change in ovirt-node[master]: fs/__init__.py: check if it's a file before chksum

fabiand at redhat.com fabiand at redhat.com
Fri May 13 15:42:24 UTC 2016


Fabian Deutsch has posted comments on this change.

Change subject: fs/__init__.py: check if it's a file before chksum
......................................................................


Patch Set 1:

(1 comment)

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

Line 686:         # Check that the files exist
Line 687:         exists &= os.path.exists(persisted_path)
Line 688:         exists &= os.path.exists(filename)
Line 689: 
Line 690:         if exists and check_is_in_sync and os.path.isfile(filename):
Why is the isfile needed here?

Would it maybe better to rather use isfile above rather than exists() (in line 688)
Line 691:             # If requested, also check that the contents match
Line 692:             current_checksum = self.checksum(filename)
Line 693:             stored_checksum = self.checksum(persisted_path)
Line 694:             exists &= stored_checksum == current_checksum


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8a50dca7521336a9feafbc6c03fa38e1a57a6ba9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Anatoly Litovsky <tlitovsk at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Ryan Barry <rbarry at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes



More information about the node-patches mailing list