[node-patches] Change in ovirt-node[master]: fix dracut ovirt_cleanup to remove bashisms

mburns at redhat.com mburns at redhat.com
Mon Oct 15 00:52:28 UTC 2012


Michael Burns has uploaded a new change for review.

Change subject: fix dracut ovirt_cleanup to remove bashisms
......................................................................

fix dracut ovirt_cleanup to remove bashisms

ovirt-cleanup runs in /bin/sh, not bash.  need to avoid [[ ]]
bashisms.

Change-Id: I87633580c9bce2726eb3296f91d2c4e2e946ea38
Signed-off-by: Mike Burns <mburns at redhat.com>
---
M dracut/ovirt-cleanup.sh
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/37/8537/1

diff --git a/dracut/ovirt-cleanup.sh b/dracut/ovirt-cleanup.sh
index 34e4337..5b84b4d 100755
--- a/dracut/ovirt-cleanup.sh
+++ b/dracut/ovirt-cleanup.sh
@@ -81,7 +81,9 @@
     info "After parsing \"$dev\", we got \"$device\""
     echo "Wiping LVM from device: ${device}"
     # Ensure that it's not read-only locking
-    sed -i "s/locking_type =.*/locking_type = 0/" /etc/lvm/lvm.conf
+    if [ -f "/etc/lvm/lvm.conf" ]; then
+        sed -i "s/locking_type =.*/locking_type = 0/" /etc/lvm/lvm.conf
+    fi
     IFS=$oldIFS
     for i in $(lvm pvs --noheadings -o pv_name,vg_name --separator=, $device* 2>/dev/null); do
         pv="${i%%,*}"
@@ -108,7 +110,9 @@
         yes | lvm pvremove -ff "$pv"
     done
     IFS=,
-    sed -i "s/locking_type =.*/locking_type = 4/" /etc/lvm/lvm.conf
+    if [ -f "/etc/lvm/lvm.conf" ]; then
+        sed -i "s/locking_type =.*/locking_type = 4/" /etc/lvm/lvm.conf
+    fi
 done
 
 IFS=$oldIFS


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I87633580c9bce2726eb3296f91d2c4e2e946ea38
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Michael Burns <mburns at redhat.com>



More information about the node-patches mailing list