From 04f17482e97c1c7ee12f7f99bafc2dc9dbfc9a95 Mon Sep 17 00:00:00 2001 From: Vladimir Kozhukalov Date: Fri, 31 Jan 2014 14:32:00 +0400 Subject: [PATCH] Removed -cciss-* tail from /dev/disk/by-path links It is to address the issue which appears when centos udev names smart array devices like this /dev/disk/by-path/pci-0000:06:00.0-cciss-disk0 and debian-installer udev names them like this /dev/disk/by-path/pci-0000:06:00.0 and can not find device. Change-Id: I052ae1839b49f4abbd12f44582d53923e0836411 --- bin/agent | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/agent b/bin/agent index d59af34e01..b122238695 100755 --- a/bin/agent +++ b/bin/agent @@ -255,6 +255,13 @@ class NodeAgent def _disk_path_by_name(name) dn = "/dev/disk/by-path" basepath = Dir["#{dn}/**?"].find{|f| /\/#{name}$/.match(File.readlink(f))} + # It is to address the issue which appears when centos + # udev names smart array devices like this + # /dev/disk/by-path/pci-0000:06:00.0-cciss-disk0 + # and debian-installer udev names them like this + # /dev/disk/by-path/pci-0000:06:00.0 and can not + # find device. + basepath.sub!(/-cciss-.+/, '') basepath.split("/")[2..-1].join("/") if basepath end