Change in vdsm[master]: Added lib/vdsm/utils.py:touchFile

amuller at redhat.com amuller at redhat.com
Wed Nov 27 08:32:11 UTC 2013


Assaf Muller has posted comments on this change.

Change subject: Added lib/vdsm/utils.py:touchFile
......................................................................


Patch Set 1:

(2 comments)

....................................................
File lib/vdsm/utils.py
Line 102:     path = os.path.abspath(path)
Line 103:     return stat.S_ISBLK(os.stat(path).st_mode)
Line 104: 
Line 105: 
Line 106: def touchFile(filePath, ignoreExceptions=False):
Right now, as the only user of this function, I'd like for the current user to receive permissions for the file. I think that If at a later date fancier functionality is needed then it should be implemented then.
Line 107:     """
Line 108:     Subset of POSIX touch functionality
Line 109:     :param filePath: The file to touch
Line 110:     :param ignoreExceptions: Should file handling exceptions be ignored?


Line 110:     :param ignoreExceptions: Should file handling exceptions be ignored?
Line 111:     """
Line 112:     try:
Line 113:         with open(filePath, 'a'):
Line 114:             os.utime(filePath, None)
Done
Line 115:     except (IOError, OSError) as e:
Line 116:         if not ignoreExceptions:
Line 117:             raise e
Line 118: 


-- 
To view, visit http://gerrit.ovirt.org/21590
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifbbea57c425adc8b911bb9e1931c02edb71db820
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list