Change in vdsm[master]: fileSD: unify the metadata permissions definition
Federico Simoncelli
fsimonce at redhat.com
Thu Apr 3 20:57:54 UTC 2014
Federico Simoncelli has uploaded a new change for review.
Change subject: fileSD: unify the metadata permissions definition
......................................................................
fileSD: unify the metadata permissions definition
This refactoring is unifying the metadata permissions definition in one
constant.
Change-Id: I7e5664b88e92237c9b1f903b5142c3f2bd6ba953
Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
---
M vdsm/storage/fileSD.py
1 file changed, 5 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/26413/1
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index adf29bd..fe7a65d 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -44,6 +44,8 @@
# TBD: Do we really need this key?
FILE_SD_MD_FIELDS[REMOTE_PATH] = (str, str)
+FILE_SD_MD_PERMISSIONS = 0o660
+
# Specific stat(2) block size as defined in the man page
ST_BYTES_PER_BLOCK = 512
@@ -168,7 +170,7 @@
for metaFile in (sd.LEASES, sd.IDS, sd.INBOX, sd.OUTBOX):
try:
fpath = os.path.join(self.getMDPath(), metaFile)
- procPool.os.chmod(fpath, 0o660)
+ procPool.os.chmod(fpath, FILE_SD_MD_PERMISSIONS)
except Exception as e:
raise se.StorageDomainMetadataCreationError(
"Lease permission change file '%s' failed: %s"
@@ -188,8 +190,8 @@
for metaFile in sd.METADATA_SIZEMB.iterkeys():
try:
- procPool.truncateFile(
- os.path.join(metadataDir, metaFile), 0, 0o660)
+ procPool.truncateFile(os.path.join(metadataDir, metaFile), 0,
+ FILE_SD_MD_PERMISSIONS)
except Exception as e:
raise se.StorageDomainMetadataCreationError(
"create meta file '%s' failed: %s" % (metaFile, str(e)))
--
To view, visit http://gerrit.ovirt.org/26413
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e5664b88e92237c9b1f903b5142c3f2bd6ba953
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
More information about the vdsm-patches
mailing list