[NEW PATCH] BZ#XXXXXX Use only os.access to check permissions (via gerrit-bot)
by Federico Simoncelli
New patch submitted by Federico Simoncelli (fsimonce(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/733
commit 296dd556ea6cb51301a305971e2f5a1566d9f93a
Author: Federico Simoncelli <fsimonce(a)redhat.com>
Date: Fri Jul 22 14:48:56 2011 +0000
BZ#XXXXXX Use only os.access to check permissions
Change-Id: Ic7b892886416e866178ac88c04cbfb68ed0c055b
diff --git a/vdsm/storage/fileUtils.py b/vdsm/storage/fileUtils.py
index adbbf4b..c76e097 100644
--- a/vdsm/storage/fileUtils.py
+++ b/vdsm/storage/fileUtils.py
@@ -182,24 +182,20 @@ def validatePermissions(targetPath):
if st.st_uid != uid or st.st_gid != gid:
raise se.StorageServerAccessPermissionError(targetPath)
-def pathExists(filename, writeable=False):
+def pathExists(filename, writable=False):
# This function is workarround for a NFS issue where
# sometimes os.exists/os.access fails due to NFS stale handle.
- # In such cases we should try again and stat the file
+ try:
+ os.stat(filename)
+ except OSError:
+ return False
+
check = os.R_OK
- if writeable:
- check |= os.W_OK
- if os.access(filename, check):
- return True
+ if writable:
+ check |= os.W_OK
- try:
- s = os.stat(filename)
- if check & s[0] == check:
- return True
- except OSError:
- pass
- return False
+ return os.access(filename, check)
def cleanupfiles(filelist):
"""
11 years, 10 months
[NEW PATCH] BZ#726410 - Ignore patitioned device (again) (via gerrit-bot)
by smizrahi@redhat.com
New patch submitted by Saggi Mizrahi (smizrahi(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/761
commit 1c34b5109a8b53aaa5d6a97d22450601609df6e6
Author: Saggi Mizrahi <smizrahi(a)redhat.com>
Date: Thu Jul 28 16:51:10 2011 +0300
BZ#726410 - Ignore patitioned device (again)
Change-Id: I165dd0c867e155bde3971a3600cb20429095f05b
diff --git a/vdsm/storage/devicemapper.py b/vdsm/storage/devicemapper.py
index bf155bc..bb6b7e0 100644
--- a/vdsm/storage/devicemapper.py
+++ b/vdsm/storage/devicemapper.py
@@ -60,6 +60,11 @@ def getDevName(dmId):
with open(nameFilePath, "r") as f:
return f.readline().rstrip("\n")
+def getDevUuid(dmId):
+ nameFilePath = os.path.join(getSysfsPath(dmId), "dm", "uuid")
+ with open(nameFilePath, "r") as f:
+ return f.readline().rstrip("\n")
+
def resolveDevName(devName):
try:
if os.path.exists(getSysfsPath(devName)):
@@ -83,6 +88,9 @@ def isBlockDevice(devName):
except OSError:
return False
+def isPartitioned(devName):
+ devName = resolveDevName(devName)
+ return (len(getHolders(devName)) > 0)
def getAllSlaves():
deps = {}
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 558e162..92255e0 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -719,6 +719,15 @@ class HSM:
if not typeFilter(dev):
continue
+ partitioned = devicemapper.isPartitioned(dev['guid'])
+ # One day we'll stop hiding partitioned devices and let
+ # the gui grey them out so users would not just wonder
+ # where is the device. Until that glorious day leave this
+ # here.
+ if partitioned:
+ self.log.warning("Ignoring partitioned device %s", dev)
+ continue
+
pvuuid = ""
vguuid = ""
@@ -727,11 +736,16 @@ class HSM:
pvuuid = pv.uuid
vguuid = pv.vg_uuid
- devInfo = {'GUID': dev.get("guid", ""), 'pvUUID': pvuuid, 'vgUUID': vguuid,
- 'vendorID': dev.get("vendor", ""), 'productID': dev.get("product", ""),
- 'fwrev': dev.get("fwrev", ""), "serial" : dev.get("serial", ""),
- 'capacity': dev.get("capacity", "0"), 'devtype': dev.get("devtype", ""),
- 'pathstatus': dev.get("paths", []), 'pathlist': dev.get("connections", [])}
+ devInfo = {'GUID': dev.get("guid", ""), 'pvUUID': pvuuid,
+ 'vgUUID': vguuid, 'vendorID': dev.get("vendor", ""),
+ 'productID': dev.get("product", ""),
+ 'fwrev': dev.get("fwrev", ""),
+ "serial" : dev.get("serial", ""),
+ 'capacity': dev.get("capacity", "0"),
+ 'devtype': dev.get("devtype", ""),
+ 'pathstatus': dev.get("paths", []),
+ 'pathlist': dev.get("connections", []),
+ 'partitioned': partitioned}
for path in devInfo["pathstatus"]:
path["lun"] = path["hbtl"].lun
del path["hbtl"]
@@ -739,8 +753,6 @@ class HSM:
devices.append(devInfo)
except se.InvalidPhysDev:
pass
- except se.PartitionedPhysDev:
- self.log.warning("Ignore partitioned device %s", dev)
return devices
11 years, 10 months
[NEW PATCH] BZ#716964 - Add "devcapacity" to PV info (via gerrit-bot)
by juan.hernandez@redhat.com
New patch submitted by Juan Hernandez (juan.hernandez(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/734
commit f35033484a7e8d32b32077c3cd8f2bdaa14c363c
Author: Juan Hernandez <juan.hernandez(a)redhat.com>
Date: Fri Jul 22 20:56:33 2011 +0200
BZ#716964 - Add "devcapacity" to PV info
Add a new "devcapacity" field to the PV info provided by VDSM.
This is obtained from the "dev_size" from "pvs". This and change
Ic0bd3c94a6e4999cb91f96c798a0108890321fbd in RHEV-M are required
to fix the bug.
Change-Id: Ic0bd3c94a6e4999cb91f96c798a0108890321fbd
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index ef472af..f0294e7 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1398,6 +1398,7 @@ class HSM:
info["fwrev"] = "0000"
info["devtype"] = devtype
info["capacity"] = str(pv.size)
+ info["devcapacity"] = str(pv.dev_size)
info["vgUUID"] = str(pv.vg_uuid)
info["pvUUID"] = str(pv.uuid)
info["GUID"] = str(pv.guid)
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index ef60c02..076b776 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -131,7 +131,7 @@ log = logging.getLogger("Storage.LVM")
LVM_DEFAULT_TTL = 100
-PV_FIELDS = "uuid,name,size,vg_name,vg_uuid,pe_start,pe_count,pe_alloc_count,mda_count"
+PV_FIELDS = "uuid,name,size,vg_name,vg_uuid,pe_start,pe_count,pe_alloc_count,mda_count,dev_size"
VG_FIELDS = "uuid,name,attr,size,free,extent_size,extent_count,free_count,tags"
LV_FIELDS = "uuid,name,vg_name,attr,size,seg_start_pe,devices,tags"
11 years, 10 months
Change in vdsm[master]: BZ#726941 Force VDSM_DIR in sys.path
by Dan Kenigsberg
Dan Kenigsberg has submitted this change and it was merged.
Change subject: BZ#726941 Force VDSM_DIR in sys.path
......................................................................
BZ#726941 Force VDSM_DIR in sys.path
Change-Id: I9d951b1263bac52c350fe02012a5cfeeef48ba70
---
M vds_bootstrap/vds_bootstrap.py
1 file changed, 3 insertions(+), 12 deletions(-)
Approvals:
Dan Kenigsberg: Verified; Looks good to me, approved
--
To view, visit http://gerrit.usersys.redhat.com/767
To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9d951b1263bac52c350fe02012a5cfeeef48ba70
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
11 years, 10 months
Change in vdsm[master]: BZ#726941 Force VDSM_DIR in sys.path
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: BZ#726941 Force VDSM_DIR in sys.path
......................................................................
Patch Set 2: Verified; Looks good to me, approved
--
To view, visit http://gerrit.usersys.redhat.com/767
To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I9d951b1263bac52c350fe02012a5cfeeef48ba70
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
11 years, 10 months