From 2d71f207de2f06c0d3917311e686ddfe0ab024e0 Mon Sep 17 00:00:00 2001 From: Zhu Lingshan Date: Wed, 2 May 2018 17:47:29 +0800 Subject: [PATCH] change RE for LUN path Change regular expression for matching a LUN path, in ordr to pick file names include special characters. --- package/yast2-iscsi-lio-server.changes | 8 ++++++++ package/yast2-iscsi-lio-server.spec | 2 +- src/include/iscsi-lio-server/TargetData.rb | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/package/yast2-iscsi-lio-server.changes b/package/yast2-iscsi-lio-server.changes index 9423ab4..bfa376e 100644 --- a/package/yast2-iscsi-lio-server.changes +++ b/package/yast2-iscsi-lio-server.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed May 2 09:43:35 UTC 2018 - lszhu@suse.com + +- bsc#1091626 + Change regular expression for matching a LUN path, in order + to pick file names include special characters. +- 4.10 + ------------------------------------------------------------------- Sat Apr 28 05:59:05 UTC 2018 - lszhu@suse.com diff --git a/package/yast2-iscsi-lio-server.spec b/package/yast2-iscsi-lio-server.spec index ceabcb8..e8b0f87 100644 --- a/package/yast2-iscsi-lio-server.spec +++ b/package/yast2-iscsi-lio-server.spec @@ -17,7 +17,7 @@ Name: yast2-iscsi-lio-server -Version: 4.0.9 +Version: 4.0.10 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/src/include/iscsi-lio-server/TargetData.rb b/src/include/iscsi-lio-server/TargetData.rb index 8f114ce..cffc2d7 100644 --- a/src/include/iscsi-lio-server/TargetData.rb +++ b/src/include/iscsi-lio-server/TargetData.rb @@ -323,7 +323,7 @@ class TargetData #match lun name like [fileio/iscsi_file1 or [block/iscsi_sdb RE_LUN_NAME = /\[(fileio|block)\/[\w\_\-\d]+\s/ #match lun patch like:(/home/lszhu/target1.raw) or (/dev/sdb) - RE_LUN_PATH = /[(]\/(\w|\.|\/)+[)]/ + RE_LUN_PATH = /\(\/.+\)\ / # match portal like 0.12.121.121:3260 RE_PORTAL = /(\d{1,3}\.){3}\d{1,3}:\d{1,5}/ @@ -468,7 +468,7 @@ def analyze # lun_num_int is a number like 1,3,57. lun_num_int = lun_num[3,lun_num.length] lun_path_tmp = RE_LUN_PATH.match(line).to_s - lun_path = lun_path_tmp[1,lun_path_tmp.length-2] + lun_path = lun_path_tmp[1,lun_path_tmp.length-3] if !File.exist?(lun_path) msg = format(_("Cannot access the storage %s.\n" \ "Please consider reconnecting the storage or\n" \