All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - vdo: lvm_import_vdo correct parsing output
Date: Thu, 29 Jun 2023 18:25:01 +0000 (GMT)	[thread overview]
Message-ID: <20230629182501.7C86D3858412@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8b75bbe47d2a2961b0fb029ad7a01dc37ee6a8e5
Commit:        8b75bbe47d2a2961b0fb029ad7a01dc37ee6a8e5
Parent:        e48c9826e3069b06a5aa31e1e59200dce4915983
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Thu Jun 29 13:06:18 2023 +0200
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Thu Jun 29 13:10:42 2023 +0200

vdo: lvm_import_vdo correct parsing output

Output from vdo manager may actually indent output with spaces,
so trim leading and ending space.

Also add support for verbosity flag for vdo conversion tool.
---
 scripts/lvm_import_vdo.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/lvm_import_vdo.sh b/scripts/lvm_import_vdo.sh
index 307233429..319bcb33d 100755
--- a/scripts/lvm_import_vdo.sh
+++ b/scripts/lvm_import_vdo.sh
@@ -370,7 +370,7 @@ convert_non_lv_() {
 	fi
 
 	verbose "Moving VDO header."
-	output=$(dry "$VDO" convert $VDOCONF --force --name "$VDONAME")
+	output=$(dry "$VDO" convert $VDOCONF $VERB --force --name "$VDONAME")
 
 	if [ "$ABORT_AFTER_VDO_CONVERT" != "0" ] ; then
 		verbose "Aborting VDO coversion after moving VDO, volume is useless!"
@@ -384,7 +384,8 @@ convert_non_lv_() {
 	local vdo_offset=0
 	local vdo_non_converted=0
 	while IFS=  read -r line ; do
-		case "$line" in
+		# trim leading spaces
+		case "$(echo $line)" in
 		"Non converted"*) vdo_non_converted=1 ;;
 		"Length"*) vdo_length=${line##* = } ;;
 		"Conversion completed"*)
@@ -579,7 +580,7 @@ EOF
 	verbose "VDO conversion parameters: $VDO_ALLOCATION_PARAMS"
 
 	verbose "Stopping VDO volume."
-	dry "$VDO" stop $VDOCONF --name "$VDONAME"
+	dry "$VDO" stop $VDOCONF --name "$VDONAME" $VERB
 
 	# If user has not provided '--yes', prompt before conversion
 	if [ -z "$YES" ] && [ "$USE_VDO_DM_SNAPSHOT" != "1" ]; then


                 reply	other threads:[~2023-06-29 18:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230629182501.7C86D3858412@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.