Change in vdsm[master]: mkimage: check image attributes after creation

nsoffer at redhat.com nsoffer at redhat.com
Fri Nov 13 13:49:48 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: mkimage: check image attributes after creation
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

https://gerrit.ovirt.org/#/c/48540/2/vdsm/mkimage.py
File vdsm/mkimage.py:

Line 165: def _check_attributes(path, uid, gid, mode):
Line 166:     try:
Line 167:         info = os.stat(path)
Line 168:     except OSError:
Line 169:         logging.warn('cannot access %s for checking', path)
We should fail loudly here, no need to handle the exception.
Line 170:     else:
Line 171:         if info.st_uid != uid:
Line 172:             logging.warn('wrong uid for %s: expected=%i found=%i',
Line 173:                          path, uid, info.st_uid)


Line 169:         logging.warn('cannot access %s for checking', path)
Line 170:     else:
Line 171:         if info.st_uid != uid:
Line 172:             logging.warn('wrong uid for %s: expected=%i found=%i',
Line 173:                          path, uid, info.st_uid)
Please use logging.warning, we have more of these and we should be consistent.
Line 174:         if info.st_gid != gid:
Line 175:             logging.warn('wrong gid for %s: expected=%i found=%i',
Line 176:                          path, gid, info.st_gid)
Line 177:         current_mode = stat.S_IMODE(info.st_mode)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3823dc604b2bafecc49154491d1815670a3600fa
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list