Martin Polednik has uploaded a new change for review.

Change subject: supervdsm: use os.path instead of string concatenation
......................................................................

supervdsm: use os.path instead of string concatenation

supervdsmServer uses string concatenation to construct paths to
udev rules. In python, using os.path collection of functions is
the preferred way to handle filesystem paths. This patch implements
using os.path tools.

Change-Id: Ib80b69743a7a0765947ba0cf3aaaa00b4b05b7d2
Signed-off-by: Martin Polednik <mpoled...@redhat.com>
---
M vdsm/supervdsmServer
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/26/37226/1

diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index fb25530..5e446c9 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -76,13 +76,15 @@
 from vdsm.config import config
 import mkimage
 
-_UDEV_RULE_FILE_DIR = "/etc/udev/rules.d/"
+_UDEV_RULE_FILE_DIR = os.path.abspath("/etc/udev/rules.d/")
 _UDEV_RULE_FILE_PREFIX = "99-vdsm-"
 _UDEV_RULE_FILE_EXT = ".rules"
-_UDEV_RULE_FILE_NAME = _UDEV_RULE_FILE_DIR + _UDEV_RULE_FILE_PREFIX + \
-    "%s-%s" + _UDEV_RULE_FILE_EXT
-_UDEV_RULE_FILE_NAME_VFIO = _UDEV_RULE_FILE_DIR + _UDEV_RULE_FILE_PREFIX + \
-    "iommu_group_%s" + _UDEV_RULE_FILE_EXT
+_UDEV_RULE_FILE_NAME = os.path.join(
+    _UDEV_RULE_FILE_DIR, _UDEV_RULE_FILE_PREFIX + "%s-%s" +
+    _UDEV_RULE_FILE_EXT)
+_UDEV_RULE_FILE_NAME_VFIO = os.path.join(
+    _UDEV_RULE_FILE_DIR, _UDEV_RULE_FILE_PREFIX + "iommu_group_%s" +
+    _UDEV_RULE_FILE_EXT)
 
 RUN_AS_TIMEOUT = config.getint("irs", "process_pool_timeout")
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib80b69743a7a0765947ba0cf3aaaa00b4b05b7d2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpoled...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to